Steps to reproduce.
1. Create a node reference field (with module References) in a ct eg. pages.
2. On pages display settings change the format to Rendered node, then set View mode: Media gallery block
3. Add a new page content references to a media gallery node.
When view this node, will get this:
Notice: Undefined index: file in media_gallery_field_formatter_view() (line 92 of /home/panparks/public_html/sites/all/modules/contrib/media_gallery/media_gallery.fields.inc). Notice: Trying to get property of non-object in media_gallery_field_formatter_view() (line 108 of /home/panparks/public_html/sites/all/modules/contrib/media_gallery/media_gallery.fields.inc). EntityMalformedException: Missing bundle property on entity of type file. in entity_extract_ids() (line 7389 of /home/panparks/public_html/includes/common.inc).
This is because the file object isn't loaded in the field items in media_gallery_field_formatter_view().