7656 fix phonegap app crashing

Refactored file handling to handle the app returning file URI when capturing photos.
comment that this is for apple