Gallery clickfix

- move ancestor function to $ (and some fixes to it)
- allow event bubbling in the gallery lightbox info panel (fixes #6025)
need to ship this and no time to write a test today. adding to todo list...