def METHOD_NAME(self, emulator, filename, md5sum, size, strict_md5_check=True):
    """
    Search an image based on its MD5 checksum
    :param emulator: Emulator type
    :param filename: Image filename (used for ova in order to return the correct file in the archive)
    :param md5sum: Hash of the image
    :param size: File size
    :param strict_md5_check: If `True` then performs MD5 checksum checks, otherwise ignores them
    :returns: Image object or None
    """
    for remote_image in list(self._remote_images):
        if remote_image.md5sum == md5sum:
            return remote_image
        elif md5sum is None or strict_md5_check is False:  # We create a new version or allow custom files
            if filename == remote_image.filename:
                return remote_image
    for directory in self._images_dirs:
        log.debug("Search image {} (MD5={} SIZE={}) in '{}'".format(filename, md5sum, size, directory))
        if os.path.exists(directory):
            try:
                for file in os.listdir(directory):
                    if not file.endswith(".md5sum") and not file.startswith("."):
                        path = os.path.join(directory, file)
                        if os.path.isfile(path):
                            if md5sum is None or strict_md5_check is False:
                                if filename == os.path.basename(path):
                                    return Image(emulator, path)
                            else:
                                # We take all the file with almost the size of the image
                                # Almost to avoid round issue with system.
                                file_size = os.stat(path).st_size
                                if size is None or (file_size - 10 < size and file_size + 10 > size):
                                    image = Image(emulator, path)
                                    if image.md5sum == md5sum:
                                        log.debug("Found image {} (MD5={}) in {}".format(filename, md5sum, image.path))
                                        return image
            except (OSError, PermissionError) as e:
                log.error("Cannot scan {}: {}".format(path, e))
    return None