Originally posted by vanyagor bleuwater, the mis-focusing in your pictures is extreme, judging from the EXIFs your focusing point was on AUTO if I am not mistaken. My guess is that the camera just focused on the background like in the first pic. I never let my K-5 (or any other camera of that generation or older) choose the focusing point, it is not good at guessing where I want it to focus. Try to set your focus point always to the center (like I do) or use manual selection of the focus point and see if you still get any mis-focused shots.
A common mistake that beginners usually make is to let the camera choose focus point(s), and complain that the camera is not focusing on the subject that was intended. There is a lot to be learned here but it is not always the camera/lens to be blamed because like many things cameras/lenses are manufactured within certain tolerance.
We all know that k-3 has better AF system than k-5, but that is not the point here.... even if you (the OP) get the latest and greatest (even a Nikon D810), you may still run into problems such as these. The OP needs to determine if there is a FF or BF issue with the lens/camera.