It certainly looks like a classic video card failing. If it works fine a little while and then does that, it's probably overheating because the heatsink+paste is failing. If it's all the time, could also mean the card is basically dead.
It is possible to replace the card if you can still get one and opening up and fixing those iMacs is a test of patience. If you took apart the machine and saw the card you could probably see if the heatsink paste is crumbling or missing.