def common_shape(imgs, axis):
    """
    Find smallest height or width of all images.
    The value along `axis` will be `None`, the other will be
    the smallest of all values

    Args:
        imgs (list[np.array]): list of images
        axis (int): axis images will be concatenated along

    Returns:
        tuple(int): height, width
    """
    if axis == 0:
        ws = [img.shape[1] for img in imgs]
        return (None, min(ws))

    hs = [img.shape[0] for img in imgs]
    return (min(hs), None)