Check for image and video type before processing a single attachment, as it could be a different type of stream like text.