You can also download an OS installer file while booted to the external, I just prefer not to put more demands on an external boot if using a thumb drive if that's what you're using.
I think the installer file will like to be in the Applications folder for the drive to which you are booted.
I believe El Cap. is the highest you can run on your iMac (you never told me the exact model), so your choice from what Apple has to offer is Yosemite and El Cap. Remember your model came with Tiger OS so both those systems are quite a jump. System requirements typically say 2 GB RAM minimum, but when Apple says "minimum" they really mean it. I ran Mavericks (just before Yosemite) on an iMac with 4 GB RAM and it was.... okay. I now run Mavericks on with an iMac with 8 GB RAM and it feels happier. So if your 2007 has 2 GB RAM I wouldn't push it with any memory intensive stuff. If you try running a modern browser you may find it the browser crashes or is just slow because your computer is using your old, slow hard drive for extra RAM.
Don't freak out if the installation is slow. I did it recently and it took about an hour, with several automatic reboots along the way.