The error you are seeing 4MOT/4/40000003: HDD is a fan motor error. The code HDD is telling us which fan, the hard drives. I suspect you forgot to connect it or the connection is bad.
As to the upgraded HD: This series only has a SATA II (3.0 Gb/s) SATA port so the drive you put in must be able to support that SATA I/O speed. We'll need to know what make & mode of drive you put in to be sure if its compatible. Often one can encounter odd issues and a display problem is possible depending on your exact iMac model and how much RAM you have on the system.
In addition you could have a damaged display or the LVDS cable or the graphics board is messed up. You'll need to see if an external monitor works if it does that rules out the graphics board, then you only have to worry about trying out a new LVDS cable to see if that fixes things. I would also recommend you make a detailed inspection of the logic board connector. In the process of taking the cable out (or in) you could have damaged it.
To fix the HD issue I would recommend using a desktop drive not a NAS drive as you'll get better performance!
If you want to get something faster here, I do recommend a SSHD drive like a Seagate Desktop SSHD and here is the spec sheet for this series of drives: Seagate Desktop SSHD - 1 TB (ST1000DX001) or 2 TB (ST2000DX001).
If we compare the specs between the NAS and the SSHD drives the SATA interface on the NAS is a fixed SATA III (6.0 Gb/s) were as the SSHD has SATA port auto sense technology so it will work in a SATA I (1.5 Gb/s), SATA II (3.0 Gb/s) or SATA III (6.0 Gb/s) system. In your case your system is SATA II (3.0 Gb/s) so your current NAS drive is not suitable here.
While the NAS drive may appear to work it can run hot and also cause your system as a whole to run hot as the drive & system end up doing more work trying to fix the errors of the transmission between the two of them. So this could explain your display going nuts as the GPU is overheated. At this point its possible you could have damaged things do to the overheating.
OK, So we need to switch out the drive but that's only the start you also need to replace the built-in thermal sensor the original Apple drive had. You'll need to use this part: OWC In-line Digital Thermal Sensor for iMac 2009-2010 Hard Drive Upgrade I strongly recommend you don't use any software solutions here but to use the hardware solution. Over the course of time we have learned the software solution will cause hardware failure's either the fan motor will be burn't out or the constant thermal shock the system encounters with the delayed ramp up and ramp down as the software is not as fast which fatigues the logic board.
The fact you got a fan motor error implies the fan has died or is not connected. I would recommend you just replace it while you are at it. Here is the part you'll need: Hard drive fan unit P/N 922-9152.
I would also recommend you install a better thermal sensor & fan app like this one: TG Pro for less that $20 US its worth it!
Lets start there and see what happens. Hopefully your display artifacts disappear.