I am currently trying to implement a thumbnail generator to my site. I have a few photo galleries which are quite large, so i want to display all these photos as thumbnail, which can be then clicked to show the full size image. The picture path is stored in a mySQL database, and im trying to loop through this DB to retrieve all the photos for the spcific gallery, then run each ful size photo through a thumbnail generator script, to output a small version. I have this done, but the script seems tempramental to say the least! Everytime i run the script, some thumbs are display and some appear as broken links. But the pictures are different everytime, so its not like it cant find the pictures, because refreshing it display different combinations of broken img's. The thumbnail script is straight from php.net [code] <?php // File and new size //$filename = 'http://www.bradmush.co.uk/21/1.jpg'; $percent = 0.25; // Content type header('Content-type: image/jpeg'); // Get new sizes list($width, $height) = getimagesize($filename); $newwidth = $width * $percent; $newheight = $height * $percent; // Load $thumb = imagecreatetruecolor($newwidth, $newheight); $source = imagecreatefromjpeg($filename); // Resize imagecopyresized($thumb, $source, 0, 0, 0, 0, $newwidth, $newheight, $width, $height); // Output imagejpeg($thumb); ?> [/code] and i am using the follwoing code to loop through the pictures: [code] <?php $sql = "SELECT picture_path FROM loc_pictures WHERE gallery_id = '$_GET[gallery]' LIMIT 25"; $result = mysql_query($sql); echo $num = mysql_num_rows($result) . " pictures found"; $x = 1; while ($row = mysql_fetch_array($result)) { echo "<a href = '$row[picture_path]' rel = 'lightbox'>"; echo "<img src='thumb.php?filename=$row[picture_path]' border = '0' /></a>"; echo " "; $x ++; } ?> [/code] The picture path is saved in the format "../gallery/1/1.jpg" and ive also tried changing this to an absolute path, which doesn work either!! Plus, to add insult to injury sometimes i get a 403 forbidden error, which im not sure if this is related, but it isnt permanent, and seems to be remidied by refreshing my FTP?! Any help would be grand!!