code: def _load_image(cls, rkey):
          
  
          v = cls._stock[rkey]
          img = None
          itype = v['type']
          if itype in ('stock', 'data'):
              img = tk.PhotoImage(format=v['format'], data=v['data'])
          elif itype == 'created':
              img = v['image']
          else:
              img = tk.PhotoImage(file=v['filename'])
          cls._cached[rkey] = img
          logger.info('Loaded resource %s.' % rkey)
          return img
docs: Load image from file or return the cached instance.