code: def register_from_dir(cls, dir_path, prefix=''):
          
  
          for filename in os.listdir(dir_path):
              name, file_ext = os.path.splitext(filename)
              if file_ext in cls._formats:
                  fkey = '{0}{1}'.format(prefix, name)
                  cls.register(fkey, os.path.join(dir_path, filename))
docs: List files from dir_path and register images with
              filename as key (without extension)
          Additionaly a prefix for the key can be provided,
          so the resulting key will be prefix + filename