console.log("[PhotoLibrary] installing...");

var exec = require("cordova/exec");

module.exports = {
	getRandomPhotos: function (howMany, callback) {
		console.log("[PhotoLibrary] getRandomPhotos");

		if (navigator.userAgent.indexOf("Android") !== -1) {
			// Android done in JS (TODO)
			callback(null, []);
		} else {
			exec(function success(result) {
				callback(null, _.map(result || [], function (path) {
					if (path.indexOf('/var/mobile') !== -1) {
						path = 'cdvfile://localhost/persistent/' + path.replace(/.*Documents\//, '');
					}
					return path;
				}));
			}, function error(err) {
				callback(err, null);
			}, "PhotoLibrary", "getRandomPhotos", [howMany]);
		}
	}
};

console.log("[PhotoLibrary] installed.");
@@ -403,24 +403,66 @@
 on (path) %7B%0A
+%09%09%09%09%09var obj = %7B%7D;%0A%0A%09%09%09%09%09obj.path = path;%0A
 %09%09%09%09%09if (pat
@@ -502,20 +502,27 @@
 %7B%0A%09%09%09%09%09%09
-path
+obj.cdvfile
  = 'cdvf
@@ -594,16 +594,17 @@
 %0A%09%09%09%09%09%7D%0A
+%0A
 %09%09%09%09%09ret
@@ -607,20 +607,19 @@
 %09return 
-path
+obj
 ;%0A%09%09%09%09%7D)

return object with path and cdvfile instead