Photo Upload Directive (Angular JS) for Web and Cordova Apps