Your between a rock and a hard place here! If you have either the 20" or the 24" system.
The HD in these systems are a 3.5" SATA II (3.0 Gb/s) drive. The optical drives are PATA which is still slower! Most SSD's today are SATA III (6.0 Gb/s) and many are fixed speed and don't run well in older systems. You'll need to find a SSD that is able to be altered to the slower SATA speed or have the ability to auto set to the slower speed.
In the newer systems which have a SATA optical drive I often recommend just getting the dual drive upgrade kit which replaces the optical drive and then putting the SSD into it. In this case the sllloooowww PATA port makes this a no go. So then you have to swap out the HD so you gain the higher SATA port speed. But then you end up throwing away the deeper storage of the HD. A SSD with equal size is quite expensive! And given the age of this system I don't think its worth doing.
How about taking a 1/2 step here instead? What I recommend you do is replace your current HD with a SSHD hybrid drive. Here's the drive you'll need: Seagate Desktop SSHD. I recommend sticking with the 1 TB drive as being a good fit.
Here we are swapping out the 3.5" drive for a newer faster 3.5" drive which has the deep storage of a traditional HD but the speed of a SSD for booting and loading your more active apps.
If you decide to go with a 2.5" SSD you'll need to get a 2.5" to 3.5" frame to hold your SSD so it can be mounted in your system.
Lastly, review this IFIXIT guide: iMac Intel 24" EMC 2134 and 2211 Hard Drive Replacement If you jump down to Step 20 thru Step 22 it shows the steps to remount the external thermal sensor. And you do need to re-attach the thermal sensor.