code: def image_exists(self, image_id):
          
          logger.info("checking whether image '%s' exists", image_id)
          logger.debug("image_id = '%s'", image_id)
          try:
              response = self.d.inspect_image(image_id)
          except APIError as ex:
              logger.warning(repr(ex))
              response = False
          else:
              response = response is not None
          logger.debug("image exists: %s", response)
          return response
docs: does provided image exists?
  
          :param image_id: str or ImageName
          :return: True if exists, False if not