def image_shape(images):
    """Check if all image in `images` have same shape and return that shape."""
    shape = None
    for image in images:
        if not shape:
            shape = image.shape
        else:
            if shape != image.shape:
                raise ValueError
    return shape