You cannot currently have images hosted one place, and the gallery hosted another place. Actually, why would you? Why not then move the entire gallery to the CDN? That is what we have done:
https://www.photo.gallery/demo/x2/ is on
Cloudflare, and the PHP executes from our server of course, but the files and output (including images and SWF) is hosted on the cloudflare content delivery network.
For example, you can host the entire gallery at someserver.com, and then maybe you have anotherserver.com which is your actual website? Thats fine, you can just embed the imagevue2.swf some someserver into a page at anotherserver.
Of technical reasons, you cannot split the gallery parts PHP/images/swf onto different servers.
Why? First of all, because the server PHP can only read the files and execute commands if it can actually read the files/folders where it is hosted, which means it needs to be on the same server.