The following uses pgf/tikz to generate a random number out of 1, 2 and 3. In the mwe package (which is included with xcolor) there are the image files example-image-a, example-image-b, and example-image-c, so we choose them with \@alph.
\documentclass{beamer}
\usetheme{Berkeley}
\usepackage{pgf}% or \usepackage{tikz}
\usepackage{lipsum}
\makeatletter
\newcommand*{\randimg}{%
\pgfmathrandom{3}%
\includegraphics[width=\paperwidth,height=\paperheight]%
{example-image-\@alph{\pgfmathresult}}}
\makeatother
\setbeamertemplate{background}{%
\randimg%
}
\begin{document}
\begin{frame}
\frametitle{Normal}
\lipsum
\end{frame}
\begin{frame}
Foo
\end{frame}
\begin{frame}
Bar
\end{frame}
\begin{frame}
Baz
\end{frame}
\end{document}
The following uses a TeX count called \mycount to cycle through the images and doesn't need pgf or tikz anymore (just the definition of \randimg and the initialization of \mycount, the rest remains untouched):
\newcount\mycount
\newcommand*{\randimg}{%
\global\advance\mycount by 1\relax%
\ifnum\mycount>3\relax%
\global\mycount=1\relax%
\fi%
\includegraphics[width=\paperwidth,height=\paperheight]%
{example-image-\@alph{\mycount}}}