          logger.info("Loading file list from %s", self.folder)
          filter_count = 0
  
          if self._alignments is not None and self._alignments.version < 2.1:  # Legacy updating
              filelist = [os.path.join(self.folder, face)
                          for face in os.listdir(self.folder)
                          if self.valid_extension(face)]
 
</s> remove         if is_legacy:  # Legacy updating
 </s> add         if self._alignments is not None and self._alignments.version < 2.1:  # Legacy updating </s> remove         is_legacy = self._alignments is not None and self._alignments.version < 2.1
 </s> add  </s> remove                 if self._alignments is None:  # Can't update legacy
                    raise FaceswapError(
                        f"The folder '{self.folder}' contains images that do not include Faceswap "
                        "metadata.\nAll images in the provided folder should contain faces "
                        "generated from Faceswap's extraction process.\nPlease double check the "
                        "source and try again.")

                if not log_once:
                    logger.warning("Legacy faces discovered. These faces will be updated")
                    log_once = True
                data = update_legacy_png_header(fullpath, self._alignments)
                if not data:
                    raise FaceswapError(
                        f"Some of the faces being passed in from '{self.folder}' could not be "
                        f"matched to the alignments file '{self._alignments.file}'\nPlease double "
                        "check your sources and try again.")
                sub_dict = data
 </s> add                 sub_dict = self._handle_legacy(fullpath, not log_once)
                log_once = True
        dupe_count = 0
        seen: dict[str, list[int]] = {}
          logger.info("Loading file list from %s", self.folder)
          filter_count = 0
        dupe_count = 0
        seen: dict[str, list[int]] = {}
  
          if self._alignments is not None and self._alignments.version < 2.1:  # Legacy updating
              filelist = [os.path.join(self.folder, face)
                          for face in os.listdir(self.folder)
                          if self.valid_extension(face)]
keep add keep keep keep keep keep
 bugfix: Alignments tool - remove faces:
  - Handle duplicate face images 
tools/alignments/media.py