images = []
# ... Fill the images ...

def get_name(image):
    # Get the name of the image (stripping the
    # file extension)
    # name = TODO
    return name

# Then for every image, create its own Web page...
for (i, image) in enumerate(images):
    name = get_name(image)

    f = open('page-%s.html', 'w')
    f.write('''\
<html>
<body>
    <h1>%(name)s</h1>
    <img src="%(image)s"><br>
''' % {'name': name, 'image': image})

    # Add links for the previous page, the next
    # page, and the home page.
    def add_link(number):
        name = get_name(images[number])
        f.write('<a href="page-%s.html">%s</a><br>' % \
            (num, name)
        )

    if i > 0:
        add_link(i - 1)
    if i < len(image) - 1:
        add_link(i + 1)

    f.write('''\
</body>
</html>
''')
    f.close()

# And finally create a home page to list every image.
f = open('index.html', 'w')

# TODO: write the list of the images

f.close()