<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, id=None, tag=None):
 """ Check if specified image exists """

        exists = False
        if id and self.image_by_id(id):
            exists = True
        elif tag and self.image_by_tag(tag):
            exists = True

        return exists