Hola, un pequeño aporte:
Código PHP:
//reemplaza tu foreach por este
//o agregale lo que le agregue, si lo distingues
foreach($files as $file)
{
list($w,$h)=getimagesize($images.$file);
if(($colCtr%$cols) == 0)
echo '</tr><tr><td colspan="2"><hr /></td></tr><tr>';
echo '<td align="center"><a href="' . $images . $big . $file . '">
<img src="' . $images . $file . '" width="'.($w/4).'" height="'.($h/4).'" /></a></td>';
$colCtr++;
}
Si tengo la voluntad suficiente, hago el contador para paginar
Saludos...!