def image_size(size):
    """
    Determine the image size of the images to be displayed in GUI
    The original width to height ratio will be preserved.

    Max width/height is set to be 300, and the other dimension will be
    adjusted accordingly.

    Args:
        size (list): Original image size

    Returns:
        new_size (list): New image size suitable for GUI
    """
    l_max = max(size)
    if l_max > 300:
        num = l_max/300
    else:
        num = 1
    w = round(size[0] / num)
    h = round(size[1] / num)
    new_size = [w, h]
    return new_size