              name = os.path.splitext(name)[0]
              name = name[name.rfind("_") + 1:].title()
              try:
                  logger.debug("Displaying preview: '%s'", img)
                  size = self.get_current_size(name)
                  self.previewtrain[name] = [Image.open(img), None, modified]
                  self.resize_image(name, size)
                  self.errcount = 0
              except ValueError:
                  # This is probably an error reading the file whilst it's
                  # being saved  so ignore it for now and only pick up if
 
</s> remove                 self.errcount = 0
 </s> add                 self._errcount = 0 </s> remove                                img, self.errcount)
                if self.errcount < 10:
                    self.errcount += 1
 </s> add                                img, self._errcount)
                if self._errcount < 10:
                    self._errcount += 1 </s> remove         for img in imagefiles:
 </s> add         for img in image_files: </s> remove                 scale = framesize[1] / float(displayimg.size[1])
                size = (int(displayimg.size[0] * scale), framesize[1])
 </s> add                 scale = frame_dims[1] / float(displayimg.size[1])
                size = (int(displayimg.size[0] * scale), frame_dims[1]) </s> remove                     self.previewtrain[name] = None

    def get_current_size(self, name):
        """ Return the size of the currently displayed image """
 </s> add                     self._previewtrain[name] = None

    def _get_current_size(self, name):
        """ Return the size of the currently displayed training preview image.

        Parameters
        ----------
        name: str
            The name of the training image to get the size for

        Returns
        -------
        width: int
            The width of the training image
        height: int
            The height of the training image
        """
                size = self._get_current_size(name)
                self._previewtrain[name] = [Image.open(img), None, modified]
              name = os.path.splitext(name)[0]
              name = name[name.rfind("_") + 1:].title()
              try:
                  logger.debug("Displaying preview: '%s'", img)
                size = self._get_current_size(name)
                self._previewtrain[name] = [Image.open(img), None, modified]
                size = self._get_current_size(name)
                self._previewtrain[name] = [Image.open(img), None, modified]
                  self.resize_image(name, size)
                  self.errcount = 0
              except ValueError:
                  # This is probably an error reading the file whilst it's
                  # being saved  so ignore it for now and only pick up if
keep keep keep keep replace replace keep keep keep keep keep
 GUI Updates (#940)

* lib.gui: Update icons
* tools.cli: Add video filetype flag to mask input
* lib.gui.popup_configure: Refresh GUI on config save
* lib.gui._config: Add Icon size and load last session options
* lib.gui.control_helper - Add control modification tracking
* lib.gui - Add Projects and Last Session
- Main root title handled by projects
- Add Hotkeys
- Create projects module
- split fsw and fst filetypes
- Add last_session saving

* lib.project
- Documentation
- Ask confirm on closing unsaved project
-Fixups

* Track model folder changes
- Shuffle some globals
- Activate System Verbosity for GUI

* lib.gui.utils - Documentation and clean up
- lib.gui.custom_widgets - Create and document

* Add GUI config option to disable auto loading model stats 
lib/gui/utils.py