<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def image_exists(self, image_id):
 """ does provided image exists? :param image_id: str or ImageName :return: True if exists, False if not """

        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