code: def _set_image_id(self):
          
          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]
docs: If an existing instance is used get image id from deployment.