The issue here is that the images are being defined after the gallery is created, instead of before. To solve this, just add init -26 to the top of the definition file, i.e:
init -26: #Images ##Background image bg GrandmaHouse = "Background/Entrance.jpeg" image bg house = "Background/House.jpeg" ...etc.
Let me know if that works for you!