def compute_scale_factor(height, size):
    """
    Compute gallery conversion scale factor as a percentage.
    """
    landscape = True
    source_width = size[0]
    source_height = size[1]
    if source_width < source_height:
        landscape = False
    if landscape:
        return height/source_height * 100
    return height/source_width * 100