in reply to creating thumbnails

John,

While it would be more helpful, if you could post what errors, if any,
you are getting, right off the top of my head I would suggest you take
a look at your system() call.
system("convert -geometry ".$size."x".$size."-quality $qual $file".$prefix."$file");
Now I'll give you that you probably split the line to make it easier to
read in your post, however, the statement is probably not passing a
valid command to the shell. For example, if
$file = "someimage.jpeg";
at some point in the loop, then the system() will be called with the string
convert -geometry 100x100-quality 50 someimage.jpegtn_someimage.jpeg
Check your spacing and see if that fixes your problem.