Write captured image to JPG file