There are literally dozens or more "album" or "gallery" packages for PHP. Some are stand-alone, some plug into portal PHP scripts like e107 (
http://www.e107.org) or PHPNuke.
Do some poking around and you'll be able to find a lot of options, mostly using the gd libs to make thumbnails and the like. My website (
http://www.xepherys.net) has a PHP gallery that runs as an add-in for e107.
PHP code is always parsed on the server, so you are not able to see the code itself unless you are looking at the files on the server (console). All that is sent to the browser is a stnadard HTML page generated by the PHP parsing process.