Cloudnary Product gallery widget does not render files and causes page to hang and freez

When I try to integrate the product gallery widget using plain JS, it causes the whole page and browser to freeze. Please, I need urgent help with this issue – we just deployed our App and all our image resources are using Cloudinary service.

I tried reading their documentation and it seems to work on their platforms – but yet fails when I run the code on my local machine or when deployed code runs on my website file.

Here is the code used [cloudname has been replaced for demo purposes]

<div id="gallery_div" style="max-width:90%;margin:auto"></div>
var myGallery = cloudinary.galleryWidget({
 container: "#gallery_div",
 cloudName: "myCloudNameHere",
 mediaAssets: [{ tag: "item_id_8" }],
 carouselStyle: "thumbnails",   // default value: included for clarity
 carouselLocation: "left",     // default value: included for clarity
 viewportBreakpoints: [
   { breakpoint: 600, carouselStyle: "thumbnails", carouselLocation: "bottom" },
   { breakpoint: 300, carouselStyle: "indicators", carouselLocation: "bottom", navigation: "always" } ]
});
myGallery.render();