Exactly. The iPhone 4 was a BIG step up in camera quality and it's regarded as one of the better camera phones out now (not including those ones with huge optical zooms and stuff). The 3GS is average at best and only really improved over the now 2.5 year old 3G by adding autofocus...
The sensor on the 4 is still a lot better than the 3GS, regardless of the former having a higher megapixel count.