def is_image_file(filename):
    """ Check if file is an image
    :param filename: file name string
    :return: Boolean toggle

    """

    return any(filename.endswith(extension) for extension in ['.bmp', '.png', '.jpg', '.jpeg', '.JPG', '.JPEG', '.PNG'])