XenForo already displays the main content template name as it is used as a class name on the main content container. e.g. in a thread:
View attachment 66725
So you can do the same for the gallery.
Failing that, you would need to find something in the source code that might be relatively unique and then search templates for that text.