NECROBUMP!!!
Alright, so I was having all the symptoms being discussed in this thread. Having worked on Xboxes a lot (and as a user above said), I figured the GPUs solder points were disconnecting so they would need to be reflowed. Since I could not find a guide for an iMac and aiming a heatgun at this computer is not a top priority, I figured I would try fix the issues the hobo way (see towel trick for Xbox)
So basically, the computer would have grey streaks then a box of black pixels in the bottom right corner after booting. Leaving the computer at this screen for a while got it really hot, then it booted fine. When this happened again and the fix worked again, the problem was obvious.
So, I booted into Windows and played sauna. I installed Macs Fan Control by CrystalIDEA (amazing program, fixed my issues of full speed HDD fans after non-Apple HDD replacement too) and found a game that would work. Settled on State of Decay. Launched the game, set affinity to core 3, priority to lowest and set the ODD fan controller to min 75 and max 85 (Celsius), minimized the game and put up with Windows for a week. Let the computer run 24/7 with the GPU diode averaging about 78 degrees and it seems fixed!
Yes, I know it's not a permanent, or particularly efficient, fix, but it's been fine for a month after the torture and it is free!!
Just my 2 cents on the issue.
27" 2009 with a 4850