added a check that the number of completed image upload tasks is the same as the number staged for upload.