Gallery clickfix

- move ancestor function to $ (and some fixes to it)
- allow event bubbling in the gallery lightbox info panel (fixes #6025)
seeing as this will only ever work if `c` is  selector of exactly one class, why not say argument `c` is the class name, e.g.

```
$.ancestor(e.target, 'js-gallery-lightbox-info');
```