corrected implementation of save to album ios

- previously all the blocks were being executed asynchronously and
screwing up the procedure
- separated into main function called from cordova and write image
function which is called from success block of main function creating
album
- library reference is a member variable so it’s reference is kept
throughout