If your images are sequentially numbered, it’s IMO better you use “glob” instead of “readdir” because in “glob” you can define a “filefilter”. i.e
In this the example only the path/filenames from 5 of n pictures are collected.