When showing files, sometimes they dont go in order especially if they have numbers in, such as 2.jpg and 20.jpg. So heres the answer…
You could also have used just sort($array1)