Actually, the wavelength itself decreases when the ray travels into the denser medium, since the speed of the ray decreases and the wavelength must also decrease given the frequency stays constant.
Also, there is no phase change when refraction occurs. That is, the refracted ray will always have the same phase as the incident ray.
So if you are looking at successive peaks (or any consecutive parts where the path difference is one wavelength), the image of the wavefronts in the diagram is an accurate depiction. And that is what you would see if you looked at the peaks of say, water waves in a ripple tank, moving from water of one depth to that of shallower depth (analogous to two varying media).