data is now formatted into json objects ready to be sent to the database...

....a few issues: images are now getting rotated again into the wrong viewing position.