Fixed bugs in edit and upload pictures related to switch to ndb Model