Sticky Vertical Scroll on Gallery isn't loading consistently

Hi everyone.

I added sticky vertical scroll gallery to the home page and individual project pages to my client’s website, however, the custom javascript isn’t loading properly, or loading consistently.

Sometimes all the images load + scroll works fine (yay), but sometimes the entire gallery is missing, or only half of the images are loading, or the vertical scroll doesn’t work as it should.

I am looking for help figuring out why the custom javascript isn’t loading consistently. Please note, that this is happening on Google Chrome and Firefox. I have cleared out my cookies/cache/history and used the hard-refresh.

Perhaps the javascript needs to be embedded as a code embed element instead of added to the project settings custom code section?

Here is the read-only link

Here is the website: