Code snippet for grabbing images from camera.