If you use `getFilenameExtension()` you will get the extension and the dot, or just the file name. So you will need to remove the starting dot, or add it to the arrays.