2007 iMac should allow restore over network. Restart and immediately hold down command-option-R keys using a wired (preferably APPLE brand) keyboard. Machine will show a globe at some point and start to boot. You may need to run an ethernet cable from your network to the Mac for best results (or, for any success, to be honest, on this unit).
This will allow you to install the latest OS compatible with that Mac (which is, likely, 10.11.x El Capitan). When the Restore window/menu comes up, choose
Disk Utility. Click Continue.
Select the new SSD (you may need to go to View menu and check Show All Devices). Click on the SSD, and partition it if possible into one partition. Name it Macintosh HD or similar. Format it. It should now show up in the list ready to go. Command-Q to quit Disk Utility. Now, you should be back to the main restore window. Choose (Re)Install Mac OS and go forward.
NOTE: If the SSD does not show up in Disk Utility, then it is either (a) defective, (b) installed improperly, or (c) incompatible with your iMac. On such an old Mac as this, you might find the older OWC 3G SSDs (
https://eshop.macsales.com/shop/ssd/owc/imac/2007) work best; most SSDs are 6G and can adjust as needed, but on those old Macs, some cannot, or do a terrible job of it, because of chip issues. Instead of dropping to 3G, they go to 1.5, or just do not work. I am not saying OWC SSDs are the best, but I am saying on old machines, these OWC 3Gs have worked best for me. And I have done a LOT of upgrades on these old units.
Best of luck! I have one of the 2007 iMacs behind me as I type this; it is running El Capitan, and with Brave and Opera browsers, is actually still usable.