I am writing script that scans directory with more than 100k images. It should return all files or image files from the directory. ls -l is slow (it takes few hours for the scan).