I like it but 3 different functions and they are all the same except the filetype right?
Why not use a variable to hold the filetype like.
function thumbs($image_name)
{
global $dir;
global $new_width;
$size = getimagesize ("$dir/$image_name");
$new_height=$size[1]*($new_width/$size[0]);
$destimg=ImageCreate($new_width,$new_height) or die("Problem Creating image");
$srcimg=ImageCreateFrom$IMAGETYPE("$dir/".$image_name) or die("Problem opening Source Image");
ImageCopyResized($destimg,$srcimg,0,0,0,0,$new_width,$new_height,$size[0],$size[1]) or die("Problem resizing");
Image$IMAGETYPE($destimg,"$dir/thumbs/".$image_name) or die("Problem saving");
}
if ($type=="jpeg" OR $type=="jpg" OR $type=="JPEG" OR $type=="JPG")
{
$IMAGETYPE = JPEG
thumbs ($files[$p]);
}

worth a try..