This sounds like a memory problem. Specifically cache settings. Go to the memory control panel and hit set to default, then restart.
Also, try zapping the PRAM (although I'm not sure how to do that on an iMac, look in the manual).
Hopefully, this will help.