resize picture to (512, 512) during image capture