This isn't Python, but I made a handy web page tool for viewing images in a directory. Just dump this photo_viewer.php page in a public_html web directory with images in it, and this page will let you view the images by hovering a mouse over buttons with the image names, clicking the buttons, or selecting images from an option box.
https://github.com/blaylockbk/Web-Homepage/blob/master/photo_viewer/photo_viewer.php
Example page: http://home.chpc.utah.edu/~u0553130/PhD/UWFPS_2017/time-height/photo_viewer.php