Uncaught ReferenceError: jQuery is not defined
Using the gallery on a non modular page, I am getting this error:
Uncaught ReferenceError: jQuery is not defined

Looks like jQuery isn't loaded at the time the line is executed, If I run the unitegallery() function from javascript console after page loaded, the gallery shows up!
I am using masonry theme. Didn't tried with others.
Masonry theme as I see in github (https://github.com/koca/grav-theme-masonry/blob/master/templates/partials/base.html.twig) loads jquery in page footer. Moving jquery loading to page header should make gallery work. This can be done by adding jquery in its own assets group in base template:
assets.add('jquery', {'group':'header', 'priority':101})
assets.js('header')
This is crude fix. I'll try to figure out more general solution
Already figured this out! thank you for your attention!