I used imglib in a similar stituation, heres an index for finding appropriate files and imglib.php (note copyrights etc ), monkey as required.
------------------------------------------------------------
index.php
---------
<?
include("imglib.php"

;
// the page header
include("header.inc"

;
/////////////////
// config variable
$col = 4; // number of column
$maxrow = 4; // max row for table
$dir = "./images"; // the directory where your images are
////////////////////////
// open the directory
$dh = opendir($dir);
$i=0;
while($file = readdir($dh))
{
if( (substr($file,-3)=="gif"

|| (substr($file,-3)=="jpg"

)
{
// insert all images in array
$a_img[] = $file;
$i++;
}
}
$totimg = $i; // total images number
$totxpage = $col*$maxrow; // images x page
$totpages = ($totimg%$totxpage==0)?((int)$totimg/$totxpage)

(int)($totimg/$totxpage)+1); // number of total pages
//////////////////////////////////////////////////////////////////
//
// Start to print and page break
//
//////////////////////////////////////////////////////////////////
print "<center><table width=700 bgcolor=#ffcc33 border=1 bordercolor=#000000>\n";
// start page
if($page=="" || $page==1)
{
$x=0;
$page = 1;
}
else
$x = (($page-1)*($totxpage));
$r=0;
// print of table
foreach($a_img as $key=>$val)
{
if(($x%$col)==0)
print "<tr>\n";
if($a_img[$x])
{
// create thumbnail with imglib
$hg = (getimgheight("$dir/$a_img[$x]"

);
$height = 120;
$width = (int)((getimgwidth("$dir/$a_img[$x]"

)*120/$hg);
/////////
$ctime = filectime("$dir/$a_img[$x]"

;
$sizes=getimagesize("$dir/$a_img[$x]"

;
$xx=($sizes[0] + 15);
$yy=($sizes[1] + 15 );
//print_r($sizes)."<br>";
print "<td align=center>
<a href=\"#\" onclick='window.open(\"$dir/$a_img[$x]\", \"popup\",\"width=$xx,height=$yy,scrollbars=no,menubar=no,resizable=no \"

;'
><img src=\"$dir/$a_img[$x]\" height=$height width=$width border=0></a>
<br>$dir/$a_img[$x]<br>".date("d/m/Y",$ctime)."</td>\n";
/*
print "
<td align=center>
<a href=\"$dir/$a_img[$x]\" target=\"_new\">
<img src=\"$dir/$a_img[$x]\" height=$height width=$width border=0></a>
<br>$dir/$a_img[$x]<br>".date("d/m/Y",$ctime)."</td>\n
";
*/
}
if(($x%$col) == ($col-1))
{
print "</tr>\n";
$r++;
}
if($r==$maxrow)
{
print "</table>\n";
break;
}
else
$x++;
}
// page break
print "<br><hr width=780 color=#0000FF><font size=2 face=verdana>";
if($totimg>$totxpage)
{
if($totpages>$page)
{
$next = $page+1;
$back = ($page>1)?($page-1):"1";
if($page>1)
{
$back = $page-1;
print "<a href=index.php?page=$back><< back </a>";
}
print " <b>gallery $page of $totpages</b> <a href=index.php?page=$next>next >></a>";
}
else
{
$next = (($page-1)==0)?"1"

$page-1);
print "<a href=index.php?page=$next><< back</a> <b>gallery $page of $totpages</b> ";
}
}
///
//////////////////////////////////////////////////////////////////////////////////////////////////
// your footer page
include("footer.inc"

;
?>
------------------------------------------------------------
imglib.php
----------
<?
// IMAGE LIBRARY 1.0 FOR PHP WITHOUT USING GDI
// THIS SCRIPT IS MADE BY SLIM WEB ARCHITECTURE
//
// This script is made with help from a perl based script of origin unknown
// It is intended for those whose webhost does not have the GD library installed
// If anyone knows how to read and or write JPG, GIF or PNG feel free to add it to this script
// The nice thing about PHP is its possiblities. The bad thing is that virtually no provider has its full capabilities installed
function getimgwidth($filename) {
global $imgw,$imgh;
$ext=strtoupper(substr($filename,-3));
switch ($ext) {
case "GIF":readgif($filename);return $imgw;break;
case "PNG":readpng($filename);return $imgw;break;
case "JPG":readjpg($filename);return $imgw;break;
case "PEG":readjpg($filename);return $imgw;break;
default: return "0";
}
}
function getimgheight($filename) {
global $imgw,$imgh;
$ext=strtoupper(substr($filename,-3));
switch ($ext) {
case "GIF":readgif($filename);return $imgh;break;
case "PNG":readpng($filename);return $imgh;break;
case "JPG":readjpg($filename);return $imgh;break;
case "PEG":readjpg($filename);return $imgh;break;
default: return "0";
}
}
function readpng($imgfn) {
global $imgw,$imgh;
$imgfd = fopen ($imgfn, "r"

;
$imgheader=fread ($imgfd, 8);
if ($imgheader!=chr(211)."PNG\r\n".chr(32)."\n" && $imgheader!=chr(137)."PNG".chr(13).chr(10).chr(26).chr(10)) {
fclose($imgfd);
// return "not a PNG file: *".ord($imgheader[0])."*".ord($imgheader[1])."*".ord($imgheader[2])."*".ord($imgheader[3])."*".ord($imgheader[4])."*".ord($imgheader[5])."*".ord($imgheader[6])."*".ord($imgheader[7])."*"

;
return "0";
}
$imgheader=fread ($imgfd, 8);
$imgheader=unpack("Nw",fread ($imgfd, 4));
$imgw=$imgheader["w"];
$imgheader=unpack("Nh",fread ($imgfd, 4));
$imgh=$imgheader["h"];
fclose($imgfd);
return "width=$imgw height=$imgh";
}
function readjpg($imgfn) {
global $imgw,$imgh;
$M_SOF0 = chr(192);
$M_SOF15 = chr(207);
$M_SOI = chr(216);
$M_EOI = chr(217);
$M_SOS = chr(218);
$M_COM = chr(254);
$MARKER = chr(255);
$imgfd = fopen ($imgfn, "r"

;
$imgheader=fread ($imgfd, 2);
if ($imgheader[0]!=$MARKER || $imgheader[1]!=$M_SOI) {
fclose($imgfd);
// die("not a JPG file"

;
return "0";
}
while (1) {
$db=0;
$c1=fread ($imgfd, 1);
while ($c1 != $MARKER) {
$db++;
$c1 = fread ($imgfd, 1);
}
while ($c1 == $MARKER) {
$c1 = fread ($imgfd, 1);
}
// if ($db) {
// echo "Warning: garbage data found in JPG file \"$imgfn\"\n";
// }
if ($c1 >= $M_SOF0 && $c1 <= $M_SOF15) {
// Do we have width and height?
$imgheader = unpack("nl/Cd/nh/nw", fread ($imgfd, 7));
$l = $imgheader["l"];
$d = $imgheader["d"];
$imgh = $imgheader["h"];
$imgw = $imgheader["w"];
fclose($imgfd);
return "width=$imgw height=$imgh";
} elseif ($c1 == $M_SOS || $c1 == $M_EOI) {
// Did we reach header end?
fclose($imgfd);
// die("endoffile"

;
return "0";
} else {
// Otherwise, skip this variable
$junk=unpack("ndummy", fread ($imgfd, 2));
$l = ushort($junk["dummy"]) - 2;
if ($l < 0) {
fclose($imgfd);
// die("errormarker"

;
return "0";
}
fread ($imgfd, $l);
}
}
}
function readgif($imgfn) {
global $imgw,$imgh;
$imgfd = fopen ($imgfn, "r"

;
$imgheader=fread ($imgfd, 6);
if ($imgheader != "GIF87a" && $imgheader != "GIF89a"

{
fclose($imgfd);
// die("$imgfn is not a GIF file"

;
return "0";
}
// Examine the Logical Screen Descriptor
// my($lsw, $lsh, $pf, $bg, $par) = unpack("vvCCC", read_n_bytes(7));
$imgheader = unpack("vnul/veen/Ctwee/Cdrie/Cvier", fread ($imgfd, 7));
$pf = $imgheader["twee"];
// Is it followed by a Global Color table?
if ($pf & 128) {
// Skip the Global Color Table
$GCTsize = $pf & 7;
fread ($imgfd, 3 * (2 << $GCTsize));
}
// Go through the markers in the header. Stop when height and width are
// determined or when end of header is reached
while (1) {
// Get the next marker
$c = fread ($imgfd, 1);
if ($c == chr(33)) {
// This is an Extension.
// Read the label.
$c = fread ($imgfd, 1);
// Read the remainder of this Extension Block and while we're at it,
// read all possible Data Sub-blocks as well.
while ($blksize = ord(fread ($imgfd, 1))) {
fread ($imgfd, $blksize);
}
} elseif ($c == chr(44)) {
// This is the most holy of all... The Image Descriptor.
$nheader=unpack("vnul/veen/vtwee/vdrie/Cvier", fread ($imgfd, 9));
$imgw=ushort($nheader["twee"]);
$imgh=ushort($nheader["drie"]);
fclose($imgfd);
return "width=$imgw height=$imgh";
} else {
fclose($imgfd);
return "nothing";
}
}
}
function ushort($n) {
if ($n < 0) {$n += 65536;}
return $n;
}
?>
______________________________________________________________________
There's no present like the time, they say. - Henry's Cat.