implemented resizing and lowering quality of uploaded photos