make taking photos and cropping them robust