That second pic is normal for the S5 camera unfortunately in low light it not very good, you need to have a very steady hand and turn on image stabilization to get any kind of decent shot, or just use the flash if you intend to do any close up shots in low light.
As for the front camera I've seen worst, the best I've seen to date is from the iPhone 5S, no matter what lighting conditions are like it always gives a great image from the front camera.
Tbh i do find the S5 camera abit hit & miss in both picture and video, if the conditions are right then images are some of the best you see from a smartphone, with only the Nokia 1020 being the exception , but as soon as the light becomes slightly less than ideal it's starts to struggle, where the other's will do a better job.
I think Samsung have finally realized this, so when the Note 4 arrives it will come with a now rumoured new 12mp Sony Sensor with OIS & a F2.0 lens which should in theory give it much better performance in low light, and that being the case I will buy the Note 4 on launch come September.