I may have mis-worded the original question. It's only one php file. Depending on context, it's EITHER included within an html file, OR it builds the whole page by itself. If the page contains text, the html is hand-rolled aside from the php footer. If the page is just a picture plus footer, the page is auto-generated in php. Either way, the php is only called once.
The second version-- the auto-generated pages-- is new. The php footer has been around for a while. Well, a few months at least. I added the textless pages so each large jpg would "belong" to an isolated page instead of to a gallery page requiring download of up to a few dozen thumbnails. The original form was image alone, target _blank. So the user experience is a little better but not substantively changed.