Sounds like the GPU board is failing! In its day the AMD GPU was able support the apps people where using. Sadly the Apps matured very fast and eclipsed what this GPU could support. It just doesn’t have needed compute power without overheating when pushed hard.
You might be able to get a little more life out of your system by cleaning the system of the dust buildup as well as apply a fresh coat of thermal paste on the CPU & GPU chips. In addition I would install a good thermal monitoring app like TG Pro which will allow you to see what’s happening and allow you to push the fans harder when you are pressing the GPU a bit too hard.
Here’s the guide you’ll need to follow iMac Intel 21.5" EMC 2389 GPU Card Replacement
Its a big job! You may want to find someone locally who’s done a few iMac’s already
You’ll need thermal paste and thermal pad material to make new pads for the VRAM chips before you start.
crwdns2934105:0crwdne2934105:0
crwdns2934113:0crwdne2934113:0
crwdns2915270:0crwdne2915270:0
crwdns2889612:0crwdne2889612:0
1