A PHP Error was encountered

Severity: Notice

Message: Trying to get property 'name' of non-object

Filename: templates/gallery.php

Line Number: 18