[Tex/LaTex] Large images not centered in beamer

beamerfloatshorizontal alignment

I'm using the tabular environment to place 2 figures side by side on beamer. When images are "small enough" everything is good, but if I ask for images to be a little larger (using \textwidth) the result is that they are not centered horizontally anymore. Here's an example of both not centered and centered:

\documentclass{beamer}
\usepackage[spanish,es-nodecimaldot,es-tabla]{babel}
\usepackage[T1]{fontenc}
\usepackage{tikz,graphicx,multirow,amsmath,amsfonts}
\usepackage{lmodern}

\usetheme{Goettingen}

\begin{document}

\section{First section}


\begin{frame}{Figures are not centered on the sides}{Looks bad :(}

\begin{tabular}{cc}
Some figure 1 & Some figure 2\\
\includegraphics[width=0.49\textwidth]{example-image} & \includegraphics[width=0.49\textwidth]{example-image}
\end{tabular}

\end{frame}

\begin{frame}{These are centered!}

\begin{tabular}{cc}
Some figure 1 & Some figure 2\\
\includegraphics[width=0.45\textwidth]{example-image} & \includegraphics[width=0.45\textwidth]{example-image}
\end{tabular}

\end{frame}

\end{document}

And it produces:

enter image description here

I don't know if it's because I'm using \textwidth. Maybe I should use something else instead? But I don't know what. Using scale does the same thing.

Any advice is greatly appreciated!

Best Answer

The images on your second slide aren't centered, it only looks more or less right due to the values you used. You can put your tabular in a \makebox:

\documentclass{beamer}
\usepackage[spanish,es-nodecimaldot,es-tabla]{babel}
\usepackage[T1]{fontenc}
\usepackage{tikz,graphicx,multirow,amsmath,amsfonts}
\usepackage{lmodern}

\usetheme{Goettingen}

\begin{document}

\section{First section}


\begin{frame}{Figures are not centered on the slides}{Looks bad :(}

\makebox[\linewidth]{%
 \begin{tabular}{cc}
 Some figure 1 & Some figure 2\\
 \includegraphics[width=0.49\textwidth]{example-image} & \includegraphics[width=0.49\textwidth]{example-image}
\end{tabular}}

\end{frame}
\end{document}

enter image description here