<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def refresh(self):
 """ Fetches image and their ids from the client. """

        if not self._client:
            return
        current_images = self._client.images()
        self.clear()
        self._update(current_images)
        for image in current_images:
            tags = image.get('RepoTags')
            if tags:
                self.update({tag: image['Id'] for tag in tags})