I'd look for a DVD copy of Snow Leopard. I think the last version sold was 10.6.3 (could be wrong about that). You can upgrade it to 10.6.8 after the installation is complete, using Software Update.
You want the "universal" version, that could be bought as a "standalone" DVD (i.e., not the DVD that came bundled with a Mac in the box).
The version of Migration Assistant that comes with it should be able to import your old data without problems.
If you have valued files on the old iMac, it wouldn't hurt to do a full backup of the internal drive to an external drive before you attempt the upgrade. I'd recommend CarbonCopyCloner (free to download and use for 30 days) for this job...