def check_img_ext(filename):
    """Check that file upload is an allowable image filetype"""

    allowed_image_ext = ['PNG', 'JPG', 'JPEG', 'GIF']

    if not '.' in filename:
        return False

    ext = filename.split('.')[-1]

    if ext.upper() in allowed_image_ext:
        return True 
    else:
        return False