Fixes to CapturePhoto Function