private function addImageAttributes(PictureInterface $picture, array $attributes) { if (empty($attributes)) { return $picture; } $img = $picture->getImg(); foreach ($attributes as $attribute => $value) { $img[$attribute] = $value; } $picture = new Picture($img, $picture->getSources()); return $picture; }