Some old code of mine ( with help from Nevermind from memory ). I use it quite a bit but can not seem to find a nice tidy version at the moment !
Notes:
1/ Reads a directory and displays image thumbnails in a table with links to larger versions - remove the <a href="display.php?pic='.$dirArray[$i].'" target="_self"> if not required.
2/ I have a "bodge" here for ($i=2; $i<$indexCount; $i++) to miss out the . & ..
3/ I have a version somewhere that will only sellect .jpg from the directory but can not find it at the moment.
4/ The $column=1; of the code is to start a new row after a certain amount of images defined here - if ($column==3)
You will just have to have a play around with it.
If you look back at some of my posts the fix for sellecting .jpg only and ignoring . & .. should be in there somewhere.
Anthony