code: def assure_image(fnc):
      
      @wraps(fnc)
      def _wrapped(self, img, *args, **kwargs):
          if not isinstance(img, Image):
              # Must be the ID
              img = self._manager.get(img)
          return fnc(self, img, *args, **kwargs)
      return _wrapped
docs: Converts a image ID passed as the 'image' parameter to a image object.