code: def find_thumbnail(self, width=None, height=None):
          
          if width is None and height is None:
              raise TypeError('required width and/or height')
          q = self
          if width is not None:
              q = q.filter_by(width=width)
          if height is not None:
              q = q.filter_by(height=height)
          try:
              return q.one()
          except NoResultFound:
              if width is not None and height is not None:
                  msg = 'size: ' + repr((width, height))
              elif width is not None:
                  msg = 'width: ' + repr(width)
              else:
                  msg = 'height: ' + repr(height)
              raise NoResultFound('no thumbnail image of such ' + msg)
docs: Finds the thumbnail of the image with the given ``width``
          and/or ``height``.
  
          :param width: the thumbnail width
          :type width: :class:`numbers.Integral`
          :param height: the thumbnail height
          :type height: :class:`numbers.Integral`
          :returns: the thumbnail image
          :rtype: :class:`Image`
          :raises sqlalchemy.orm.exc.NoResultFound:
             when there's no image of such size