def METHOD_NAME(filenames):
    names = set()
    for filename in filenames:
        index = filename.find(" ")
        if index > -1:
            base_filename = filename[:index]
            extension = filename.split(".")[1]
            filename = base_filename + "." + extension
        names.add(filename)
    return list(names)