Further work on image viewer. To get all required information into image viewer, implemented api function to be remote-called from js. Each project has its own api url. To get this api url into the js world, added API_PREFIX js var to main template so this is always available. To make this work implemented a template tag project_url to use in main template
Image viewer is now working