# Including an image on the section title page of beamer

I'm making a presentation on beamer and I was able to create a frame with the section title with the code: (I'm sorry for the code, didn't quite understand how to insert it correctly)

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%Section title frame
\AtBeginSection[]{
\begin{frame}
\vfill
\centering
\end{beamercolorbox}
\vfill
\end{frame}
}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%Section title frame


but now I would like to include an image on the page as well, not the same one for every section, but a particular one for each section.

Thank you

An easy solution would be to store the image name in a macro and redefine it where needed.

\documentclass{beamer}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%Section title frame
\AtBeginSection[]{
\begin{frame}
\vfill
\centering
\includegraphics[width=4cm]{\secimage}

\end{beamercolorbox}
\vfill
\end{frame}
}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%Section title frame

\newcommand{\secimage}{example-image-a}

\begin{document}

\section{A}

{
\renewcommand{\secimage}{example-image-b}
\section{B}
}

\section{C}

\end{document}