def construct_html(search_term, results):
    """
    Given a list of results, construct the HTML page.
    """
    link_format = '<a href="{0.img_url}"><img src="{0.thumb_url}" alt="{0.name}" title="{0.name}"></a>'
    html_links = '\n'.join([link_format.format(result) for result in results])

    html_output = (
        '<html>'
        '<head><title>{search_term} pictures</title></head>'
        '<body>'
        '<h1>&ldquo;{search_term}&rdquo; pictures</h1>'
        '{html_links}'
        '</body>'
        '</html>'
    ).format(search_term=search_term, html_links=html_links)

    return html_output