If you have a PPC (non-Intel) Mac you can only go as high as Leopard 10.5.8.
Requirements for OS X 10.6 'Snow Leopard'
OS 10.6 Snow Leopard is once again available from the Apple Store:
and in the UK:
but nobody knows for how long it will be available.
1) Make sure your computer meets Snow Leopard technical specifications - http://support.apple.com/kb/SP575 This mostly means making sure it is an Intel Mac and has at least 1GB RAM (at least 2 GB is recommended). Go to the Apple in the upper left corner of any window to "About This Mac". Does it mention "PowerPC" (not Intel), or Intel? To check RAM continue to "More Info...". It should say you have at least 1GB of "memory".
2) Buy a Snow Leopard disc from Apple online
or telephone Apple. In the USA: (800) 676-2775 (contact information for other countries: http://support.apple.com/kb/HE57)
Alternatively you can buy from online retailers but anticipate paying much more than the original price which is the price still charged by Apple
3) Backing up your computer before upgrading is always a good idea.
4) After installing from the DVD, update your Snow Leopard installation using Software Update or manually downloading and installing the Mac OS X 10.6.8 Update Combo v.1.1 - http://support.apple.com/kb/DL1399
Use this article to determine which iMac you have: http://support.apple.com/kb/HT1758
As you can see the G5s look identical on the outside to the early Intels. But the appearance is deceiving, as the G5 can't run higher than 10.5.8. Go to Apple menu -> About This Mac to figure out what you have. No G5 is an Intel, and no Intel is a G5.