If you use the capture plugin rather than the camera plugin, you can specify the limit you want to set for the pictures to be taken in one session. See the phonegap 3.0 capture plugin docs for reference. This also works the same in 2.2 I believe.
Here is a some code for how to invoke the capture session.
<script type="text/javascript" charset="utf-8">
// Called when capture operation is finished
//
function captureSuccess(mediaFiles) {
var i, len;
for (i = 0, len = mediaFiles.length; i < len; i += 1) {
uploadFile(mediaFiles[i]);
}
}
// Called if something bad happens.
//
function captureError(error) {
var msg = 'An error occurred during capture: ' + error.code;
navigator.notification.alert(msg, null, 'Uh oh!');
}
// A button will call this function
//
function captureImage() {
// Launch device camera application,
// allowing user to capture up to 2 images
navigator.device.capture.captureImage(captureSuccess, captureError, {limit: 2});
}
// Upload files to server
function uploadFile(mediaFile) {
var ft = new FileTransfer(),
path = mediaFile.fullPath,
name = mediaFile.name;
ft.upload(path,
"http://my.domain.com/upload.php",
function(result) {
console.log('Upload success: ' + result.responseCode);
console.log(result.bytesSent + ' bytes sent');
},
function(error) {
console.log('Error uploading file ' + path + ': ' + error.code);
},
{ fileName: name });
}
</script>
This will get you as far as image filenames and locations for the captured images. I'll try to edit my answer as to then how to get these saved to the camera roll a little later if I figure it out. Note.... this works for video also if you use the captureVideo function. Also included is the uploadFile function of which you could post these images to a server. Inside that function it shows how to reference the full path to the image file and also the image filename. This will be useful in your endeavor to get these to the camera roll. Note the fileTransfer object may require the File plugin, but also definitely requires the FileTransfer plugin.