Images won't be repeated

Changed way image files are found so that they will not be repeated
until all are used.