This could be due to the hard drive replacement. The OEM HDDs have internal temperature sensors, and most aftermarket drives do not have them.Only real issue it had was the fans running out of control,
If the HDD was replaced with a non-Apple HDD, it requires some HDD temperature sensor solution.
This can be a physical temp sensor like this one:

iMac Intel 21.5" and 27" (Late 2009-Mid 2010) SSD Temperature Sensor
Add an SSD to your iMac with this cable. A temperature sensor for the SSD is included.

There are a few other solutions as well. Some people short the pins with the temperature sensor, and some use SW solutions like Macs Fan Control.
If you have the Mac opened, I highly suggest installing a SSD instead of the HDD. It will run faster, and cooler. It will make the OS a lot more responsive.Looks like it was barely used, the hard drive has very little use on it, but I assume this is a new drive since it wasn't an Apple OEM part.
I know that you haven't used the iMac long, but a SSD will make it feel much newer than it actually is.