code: def _find_image_id(self, image_id):
          
          if not self._images:
              connection = self._connect()
              self._images = connection.get_all_images()
  
          image_id_cloud = None
          for i in self._images:
              if i.id == image_id or i.name == image_id:
                  image_id_cloud = i.id
                  break
  
          if image_id_cloud:
              return image_id_cloud
          else:
              raise ImageError(
                  "Could not find given image id `%s`" % image_id)
docs: Finds an image id to a given id or name.
  
          :param str image_id: name or id of image
          :return: str - identifier of image