keeping images side by side in overleaf code example
Example: latex two figure side by side
\documentclass[10pt,a4paper]{article}
\usepackage[demo]{graphicx}
\usepackage{subfig}
\begin{document}
\begin{figure}
\centering
\subfloat[label 1]{{\includegraphics[width=5cm]{img1} }}
\qquad
\subfloat[label 2]{{\includegraphics[width=5cm]{img2} }}
\caption{2 Figures side by side}
\label{fig:example}
\end{figure}
\end{document}