image editing and inserting into db