docs: def set_image_dimensions(self, thumbnail):
          """
          Set image dimensions from the cached dimensions of a ``Thumbnail``
          model instance.
          """
          try:
              dimensions = getattr(thumbnail, 'dimensions', None)
          except models.ThumbnailDimensions.DoesNotExist:
              dimensions = None
          if not dimensions:
              return False
          self._dimensions_cache = dimensions.size
          return self._dimensions_cache