Fixed some small problems with the image id being passed to the javascript.