So let's see if we can load the gallery into the page via AJAX and initialize it.

Try this:

HTML Code:
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <title>ColdFusion test</title>
    <style>img{ float:left;}</style>
    <button id="send">Send</button>
    <div id="result"></div>

    <script src="" type="text/javascript"></script>
    <script type="text/javascript" src=""></script>
      $("#send").on("click", function(){
          type: "GET",
          url: "gallery.cfm",
	  cache: false,
          dataType: "html",
          success:function(res)	{
HereIs a demo of it working on my server.
Notice, no page refresh.