Very strange, this should not happen, especially since if I have not touched this part of the script since 1.0. Have you tried leaving this new playthrough and then retrying the gallery again? Were you playing the downloadable version, or the online version?
Strange, never had something like that reported before. My best bet is that the game is not able to save persistent variables in a file like it is supposed to, either because the file is read only, or because it does not have the right to create the file in the first place.
Save files are located in the "save" subfolder inside the "www" folder, this should contain both the saves you did, and the save file that tracks gallery unlocks. Maybe check if it's empty, and if the folder is not read only.