A screenshot of how <a href="//commons.wikimedia.org/wiki/MediaWiki:Gadget-Gallerypreview.js" title="MediaWiki:Gadget-Gallerypreview.js">MediaWiki:Gadget-Gallerypreview.js</a> works on image pages. A yellow header represents a category. A green header represents a gallery. It automatically filters license categories.
The image is by <a href="//commons.wikimedia.org/wiki/User:Prazak" title="User:Prazak">User:Prazak</a>. The Javascript is by <a href="//commons.wikimedia.org/wiki/User:Magnus_Manske" title="User:Magnus Manske">User:Magnus Manske</a>. MediaWiki is by <a href="//commons.wikimedia.org/wiki/Special:Version" title="Special:Version">many people</a>.
Screenshot of <a href="//commons.wikimedia.org/wiki/File:Hrad_Oko%C5%99.jpg" title="File:Hrad Okoř.jpg">Image:Hrad Okoř.jpg</a> with it enabled. See: <a class="external free" href="https://commons.wikimedia.org/wiki/Image:Hrad_Oko%C5%99.jpg?withJS=MediaWiki:Gadget-Gallerypreview.js">http://commons.wikimedia.org/wiki/Image:Hrad_Oko%C5%99.jpg?withJS=MediaWiki:Gadget-Gallerypreview.js</a>