Jquery plugin not working until you refresh

Jquery plugin not working until you refresh

I'm fairly new to Jquery but have a solid understanding of HTML & CSS.

I'm currently building an app which uses the Photoswipe plugin.

If I link to the page with the plugin it doesn't work BUT if I refresh the page in a desktop browser, it loads.  It doesn't work when compiled on a mobile device at all though (as you can't refresh).

Any suggestions?