Is there a difference in the user agent between iOS 5.1 on a 3GS and a 4S?
http://www.priteshgupta.com/2012/04/detecting-ipad-3-for-spe...
PS: you may wish to add a "(-webkit-min-device-pixel-ratio: 2)" clause to your media queries if you want to target retina devices.