added check for attachment existence while images list is an array of ids