Turning captured image into resized canvas element ready to be decoded