Crashes when right-clicking are unlikely to be because there are a lot of files. It's more likely to be because one/some of the files, combined with one of the shell extensions something has installed on your system, are crashing together.
See Crash, exit or high CPU usage when viewing certain directories for troubleshooting.
That said, looking at your screenshot the program does not look like it has crashed, but like it is busy for a long time. If it comes back eventually, then something is just taking a long time to process 39,000 files, which would not be that unusual as they all have to be passed through all relevant 3rd party shell extensions (and the built-in ones that are part of the OS) to see which menu items they want to add.