If you load the javascript in the beginning of the page, you can use library directly and call NaturalGallery.add() instead of prepare a window.naturalGalleries global var.