Modified gallery.html and singlephoto.html to create photos using binary data