Last year while I was still a senior in high school, I wrote my own
Photo Gallery software (along with the rest of the CMS) for Team 228, simply because I wasn't impressed* with any of the existing open-source photo gallery software. So the Photo Gallery software I wrote for Team 228 was coded in PHP, and uses MySQL databases for the content storage.
It only took about two days to code the front end work, and a week to do all the back-end administration coding. Then, after importing nearly 60 galleries with 3,000 photos, I rewrote several scripts to optimize the execution speed and to introduce caching to relieve load on our MySQL server.
It took a fair bit of work, but I'm very impressed with the end result. Eventually I plan on making the software for the Photo Gallery open-sourced, but that's for another day.
* I took a lot of inspiration from Apple's .Mac Photo Galleries and CD-Media when I designed Team 228's Photo Gallery software last year, combining the tagging and searchability of CD-Media with the looks, functionality, and slideshow features of the .Mac galleries.