Use a better way to compare the suffix of recent files
Even better would be to use the mimetype, but that would also take more time.