I'm trying to put 2 images in a row with this code, and runs well, but... don't adapt the size of the last 2 images in a row.
\documentclass[12pt,a4paper]{article}
\usepackage{graphicx}
\usepackage{subcaption}
\begin{document}
\includegraphics[width=\linewidth]{example-image-a}
\includegraphics[width=7.5cm]{example-image-b}
and now 2
\begin{figure}
\centering
\subcaptionbox{A cat\label{cat}}
[.45\linewidth]{\includegraphics{example-image-a}}
\subcaptionbox{An elephant\label{aaa1}}
[.45\linewidth]{\includegraphics{example-image-b}}
\caption{Two animals}\label{aaa2}
\end{figure}
\end{document}

