code: def image_exists(self, id=None, tag=None):
          
          exists = False
          if id and self.image_by_id(id):
              exists = True
          elif tag and self.image_by_tag(tag):
              exists = True
  
          return exists
docs: Check if specified image exists