              logger.debug("Not enough images to generate display. (to display: %s, available "
                           "images: %s)", num_images, len(imagefiles))
              self.previewoutput = None
              return
          filenames, samples = self.get_preview_samples(imagefiles, num_images, thumbnail_size)
          show_image = self.place_previews(samples, frame_dims)
          logger.trace("Displaying preview: '%s'", filenames)
          self.previewoutput = (show_image, ImageTk.PhotoImage(show_image))
  
      @staticmethod
      def get_preview_samples(imagefiles, num_images, thumbnail_size):
          """ Return a subset of the imagefiles images
 
</s> remove         logger.trace("Image Files: %s", len(imagefiles))
        num_images = (frame_dims[0] // thumbnail_size) * (frame_dims[1] // thumbnail_size)
        if num_images > len(imagefiles):
            logger.debug("Not enough images to generate display. (to display: %s, available "
                         "images: %s)", num_images, len(imagefiles))
            self.previewoutput = None
 </s> add         # Filter to just the gui_preview if it exists in folder output
        imagefiles = [gui_preview] if gui_preview in imagefiles else imagefiles
        logger.debug("Image Files: %s", len(imagefiles))

        imagefiles = self.get_newest_filenames(imagefiles)
        if not imagefiles: </s> remove             self.previewoutput = None
 </s> add #            self.previewoutput = None </s> remove         logger.trace("num_images: %s", num_images)
 </s> add         logger.debug("num_images: %s", num_images) </s> remove     @staticmethod
    def place_previews(samples, frame_dims):
 </s> add     def place_previews(self, frame_dims):
        self.load_images_to_cache(imagefiles, frame_dims, thumbnail_size)
        if imagefiles == [gui_preview]:
            # Delete the preview image so that the main scripts know to output another
            logger.debug("Deleting preview image")
            os.remove(imagefiles[0])
        show_image = self.place_previews(frame_dims)
        logger.debug("Displaying preview: '%s'", self.previewcache["filenames"])
              logger.debug("Not enough images to generate display. (to display: %s, available "
                           "images: %s)", num_images, len(imagefiles))
              self.previewoutput = None
              return
        self.load_images_to_cache(imagefiles, frame_dims, thumbnail_size)
        if imagefiles == [gui_preview]:
            # Delete the preview image so that the main scripts know to output another
            logger.debug("Deleting preview image")
            os.remove(imagefiles[0])
        show_image = self.place_previews(frame_dims)
        logger.debug("Displaying preview: '%s'", self.previewcache["filenames"])
        self.load_images_to_cache(imagefiles, frame_dims, thumbnail_size)
        if imagefiles == [gui_preview]:
            # Delete the preview image so that the main scripts know to output another
            logger.debug("Deleting preview image")
            os.remove(imagefiles[0])
        show_image = self.place_previews(frame_dims)
        logger.debug("Displaying preview: '%s'", self.previewcache["filenames"])
        self.load_images_to_cache(imagefiles, frame_dims, thumbnail_size)
        if imagefiles == [gui_preview]:
            # Delete the preview image so that the main scripts know to output another
            logger.debug("Deleting preview image")
            os.remove(imagefiles[0])
        show_image = self.place_previews(frame_dims)
        logger.debug("Displaying preview: '%s'", self.previewcache["filenames"])
          self.previewoutput = (show_image, ImageTk.PhotoImage(show_image))
  
      @staticmethod
      def get_preview_samples(imagefiles, num_images, thumbnail_size):
          """ Return a subset of the imagefiles images
keep keep keep keep replace replace replace keep keep keep keep keep
 GUI: Preview for convert

Display preview when outputting to a stream container (e.g. video, gif) 
lib/gui/utils.py