              samples.append(np.array(img))
  
          samples = np.array(samples)
          self._previewcache["filenames"] = (self._previewcache["filenames"] +
                                             show_files)[-num_images:]
          cache = self._previewcache["images"]
          if cache is None:
              logger.debug("Creating new cache")
 
</s> remove         self._load_images_to_cache(image_files, frame_dims, thumbnail_size)
 </s> add         if not self._load_images_to_cache(image_files, frame_dims, thumbnail_size):
            logger.debug("Failed to load any preview images")
            if gui_preview in image_files:
                # Reset last modified for failed loading of a gui preview image so it is picked
                # up next time
                self._previewcache["modified"] = None
            return
 </s> remove             return
 </s> add             return False </s> remove             img = Image.open(fname)
 </s> add             try:
                img = Image.open(fname)
            except PermissionError as err:
                logger.debug("Permission error opening preview file: '%s'. Original error: %s",
                             fname, str(err))
                dropped_files.append(fname)
                continue
        if not np.any(samples):
            logger.debug("No preview images collected.")
            return False

        if dropped_files:
            logger.debug("Removing dropped files: %s", dropped_files)
            show_files = [fname for fname in show_files if fname not in dropped_files]

              samples.append(np.array(img))
  
          samples = np.array(samples)
        if not np.any(samples):
            logger.debug("No preview images collected.")
            return False

        if dropped_files:
            logger.debug("Removing dropped files: %s", dropped_files)
            show_files = [fname for fname in show_files if fname not in dropped_files]

          self._previewcache["filenames"] = (self._previewcache["filenames"] +
                                             show_files)[-num_images:]
          cache = self._previewcache["images"]
          if cache is None:
              logger.debug("Creating new cache")
keep keep add keep keep keep keep keep
 bugfix: lib.gui.utils - Catch permission error on preview image load 
lib/gui/utils.py