def is_image(path):
    """checks wether path points to an image."""
    if not is_mounted(path):
        try:
            return (imghdr.what(path) is not None)
        except:
            # continue execution outside of the if-statement
            pass
    fe = get_file_extension(path)
    if fe in (
            "rgb",
            "gif",
            "pbm",
            "pgm",
            "ppm",
            "tiff",
            "rast",
            "xbm",
            "jpeg",
            "jpg",
            "bmp",
            "png",
    ):
        return True
    else:
        return False
checks wether path points to an image.
bin/ls.py