That's php.
If you have a server that runs php you can create a file name for instance
list.php
you copy/paste this code in it
you put this file where the images are
and you modify event 2 to call list.php instead of list.txt
The php script will just look into the folder it is in, list all the files with extension, png, jpg, gif, or bmp like they are in list.txt (one file by line)
It's just more automatic. It facilitate update since you'll just have to add images in the folder.
However you'll have no control over ordering. (I don't know if the script orders alphabetically, or by date of modification...)