Updated the javascript so that it registers a device on first hitting the base page - has a heartbeat cycle every 5 seconds which can be used to send the image request