def is_image_or_dockerfile(is_image=None):
    """
    Parse the is_image option of the http data.
    1 represents the image file is an image, 0 represents the image
    file is a dockerfile used to build the image, 2 represents the container
    snapshot.
    """
    if not is_image:
        return 0
    if is_image == '1':
        return 1
    elif is_image == '2':
        return 2
    return 0