def gallery(title, image_elem_list):
    """
    Builds an image gallery out of a list of image elements. The
    gallery element is provided as a way of grouping images under
    a single heading and conserving space on the output page.

    Args:
        title: The title to display
        image_elem_list: The image elements to display.  If a single
            image element is given it will automatically be wrapped into
            a list.

    Returns:
        A dictionary with the metadata specifying that it is to be
        rendered as an image gallery
    """
    gal = {
           'Type': 'Gallery',
           'Title': title,
           'Data': image_elem_list,
           }
    return gal