Fix errors when called without an AbstractPage object

This apparently happened when trying to access non-existant images in one of our projects.