Don't custom build that site! The many uses for Drupal by Jakob Perry.
Warren is the guy who has been running Gallery for a few years now. Me? I ran it at my previous job but I didn't get into it much.
Now I'm running Drupal and on the default Apache/PHP install, PHP is limited to 8MB of RAM. That works fine for most everything... but when you get into graphics processing, it isn't even close. Graphics Processing? The image upload (and photo gallery) module for Drupal take an uploaded image file and then generates a preview size (640x480) image and a thumbnail (125x125?) image. It can use ImageMagick or the GD image processing packages.