protected function _actionUpdatephotos($context)
    {
        $this->execute('addphoto', $context);
        $photo_ids = (array) AnConfig::unbox($context->data->photo_id);

        foreach ($this->getItem()->photos as $photo) {
            if (!in_array($photo->id, $photo_ids)) {
                $this->getItem()->removePhoto($photo);
            }
        }

        return $this->getItem();
    }