One of the problems, well not so much a problem but it could be, was that if the picture sizes were not in the database I was accessing the file and reading the size. Each picture was 2 disk seeks... one to see if it exists and one to get the info. This is just not a good way of handling it. If the sizes are not in the database they will be defaulted to what ever the $theme sizes are set to in your theme.inc.php file.
