                       len(image_files), frame_dims, thumbnail_size)
          num_images = (frame_dims[0] // thumbnail_size) * (frame_dims[1] // thumbnail_size)
          logger.debug("num_images: %s", num_images)
          if num_images == 0:
              return
          samples = list()
          start_idx = len(image_files) - num_images if len(image_files) > num_images else 0
          show_files = sorted(image_files, key=os.path.getctime)[start_idx:]
          for fname in show_files:
              img = Image.open(fname)
 
</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 </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

            return False
                       len(image_files), frame_dims, thumbnail_size)
          num_images = (frame_dims[0] // thumbnail_size) * (frame_dims[1] // thumbnail_size)
          logger.debug("num_images: %s", num_images)
          if num_images == 0:
            return False
          samples = list()
          start_idx = len(image_files) - num_images if len(image_files) > num_images else 0
          show_files = sorted(image_files, key=os.path.getctime)[start_idx:]
          for fname in show_files:
              img = Image.open(fname)
keep keep keep keep replace keep keep keep keep keep
 bugfix: lib.gui.utils - Catch permission error on preview image load 
lib/gui/utils.py