I installed Magento 2.2.2 and getting issue with image gallery js. Product page images are not loading sometimes with below error
settings.$elementF.fotorama is not a function
Magento Stack Exchange is a question and answer site for users of the Magento e-Commerce platform. It only takes a minute to sign up.Sign up to join this community
I had an external script that was causing this. I'm still not sure why, but in my case it was a script from Constant Contact (yours may be different).
Instead of including it in the header scripts, I moved it into a block (not sure if that did anything) and then I added an async tag to that script. That seems to have done it.
To troubleshoot, remove all of your third party scripts and see if that makes $fotorama run consistently. If it does, add the scripts back slowly until you figure out which one is breaking $fotorama.
Add an async tag to that script, and it should work.
<script async> var _ctct_m = "<my cc id>"; </script>