Heres a simple way to do it
PHP Code:
<?php
$i=1;
$mid=3;
foreach (glob("{*.jpg,*.JPG,*.gif,*.GIF}",GLOB_BRACE) as $file)
{
echo '<a href="./'.$file.'"><img src="./thumbs/'.$file.'" border="0" width="100" hspace="5" vspace="5"></a>';
if($i == $mid)
{
echo "<br />";
$i=0;
}
$i++;
}
?>
Drop the file into the same dir as you images in the structure of
/index.php
/thumbs/
for example.
All your images and thumbs need to have the same name.
Change $mid to the number of images you want per row.