As discovered in #1333674: Conflicts with other modules so media_gallery_collection not called which creates Huge Images On Main Gallery Page, we are overwriting the page callback of the taxonomy term, which conflicts with taxonomy_display.

taxonomy_display provides a configuration page to call our own function on galleries vocabulary.

The attached patch integrates media_gallery with taxonomy_display.

Note:
If taxonomy_display with this patch is uses, it reopens the recently fixed bug #1804806: Title field in "all gallery" settings does not appear to be honored
I have opened a bug report at the taxonomy_display issue queue: #1811426: term name is not used as page title when a menu item links to it

Comments

Changed newline encoding in the new file from Windows to Unix.