From looking at sample photos from the Nikon 5200 and the Pentax S4i, it appears that the image quality is just about the same.
I think you should check out the newly introduced Konica Minolta DiMAGE X50. It is about the physical size of the Pentax camera and the image quality appears to be better.
...
I have narrowed my camera choices down to the Pentax S5i (which I would be waiting for delivery in October) which is comparable in features and performance to the Pentax S4i and also the Nikon 5200. I like the pros and cons of both cameras. I like the size of the S5i (S4i) and I like the quick scene assistance modes in the Nikon 5200. Does anyone have experience with either one of the cameras? I get mixed reviews on both the cameras in the image quality criteria, but other than that both cameras seem to have a strong following. Thanks in advance for any assistance.

Chowhound
Comic Vine
GameFAQs
GameSpot
Giant Bomb
TechRepublic