7656 fix phonegap app crashing

Refactored file handling to handle the app returning file URI when capturing photos.
can be one if statement