<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _set_image_id(self):
 """ If an existing instance is used get image id from deployment. """

        instance = self._get_instance()
        image_info = instance.storage_profile.image_reference

        if image_info.publisher:
            self.image_id = ':'.join([
                image_info.publisher, image_info.offer,
                image_info.sku, image_info.version
            ])
        else:
            self.image_id = image_info.id.rsplit('/', maxsplit=1)[1]