Photos added to db on upload, tidied rest responses
optimzied some db queries