import re


def is_image(url: str) -> bool:
    """If a image is a valid image or not.

    Examples
    ________
    >>> url = "https://i.imgur.com/a/MzgxNjI.jpg"
    >>> is_image(url)
    True
    >>> url = "https://www.google.com"
    >>> is_image(url)
    False

    Parameters
    ----------
    url : str
        The url to validate

    Returns
    -------
    bool
        The image is a valid image or not
    """
    # We cast it to bool just to make sure that it is True/False
    return bool(re.match(r"(https?:\/\/.*\.(?:png|jpg))", url))