Whenever we are sharing multiple images from gallery we are receiving as an array of blobs.The number of attachments received can be checked through numbers.So,after pusing all the attachments to an array we are checking the length of an array with numbers to perform appendAll operation.