import mimetypes


def guess_mimetype(path):
    """Define a mimetypes.guess_type() wrapper that returns just the type and
    also handles webp.
    """
    if path.endswith('.webp'):
        return 'image/webp'
    return mimetypes.guess_type(path)[0]