The iMac G5 cannot run OS X Lion, it is not possible.

You have an Intel iMac, lat 2006.

I believe you are at the top of the OS range right now, Mountain Lion may not install on that machine

BTW, while it was handy in this case, it is not a good idea to post your serial number in a public forum.