Iteration in LaTeX

I would like to use some iteration control flow to simplify the following LaTeX code.

\begin{sidewaystable}
\caption{A glance of images}
\centering
\begin{tabular}{| c ||c| c| c |c| c|| c |c| …