A quick follow up on my problems with my iMac. I have the feeling the random shutdowns are gone, since I haven't experienced any dropouts so far (knock on wood). My computer has been taken to two repair centers. Problem was, neither of them could reproduce the problem. They ran several stress tests and not a single time the iMac crashed.
The last repair center, ARC in Dilbeek nearby Brussels, decided to replace the logic board. Most of the time, random shutdowns are caused by a faulty component on the logic board. Something to do with the SMC chip. Unfortunately, after 30 minutes of working in Lightroom and Photoshop, the iMac decided to shut itself down. If that would happen they told me to replace my after-market 32GB of RAM with the original 8Gb of RAM. Didn't help. Last resort was to replace the power supply. After a brief visit to ARC they replaced it, and it seems all my troubles are gone.
Happy to be working on my iMac again and a big thumbs up for ARC!