Try running it in Safe Mode (boot with Shift key pressed until the progress bar comes up - about 30 seconds). You will have 'Safe Mode' in red top left of screen if successful.
Is the the iMac now stable? If so, your problem may the same as mine appears to be ie an over-heating GPU (graphics processor unit - video card). To test this, install smcFancontrol which allows you to speed up the CPU/GPU fan (it is shared by both) and see if the extra cooling stops the shutdowns.
The other thing you could try is to disable Quartz Extreme which is OSX's graphics accelerator software. This is for when running in normal mode. My theory is that because QE is disabled in Safe Mode, the GPU does not work anything like as hard as when QE is running and so does not overheat so no shutdowns.
I am about to try these on my iMac and will report back... MW