Fix bug with gallery indexes always rebuilding

index.html.php was being added to the folder for the gallery, the timestamp
of which was being used to determine whether that file needed to be rebuilt.
When it was cleaned up by make, the folder's modification timestamp was set,
and so it was always greater than the targeted file.