When light goes through a transparent medium, the velocity decreases below c, giving an index of refraction:
The photons always travel with velocity c. Light emerges from a confluence of a large number of photons, in a quantum mechanical superposition of their wavefunctions.
The conundrum is solved because photons can scatter elastically with atoms and the lattice itself and, within the pulse that they build up as light, they travel longer paths than the classically defined optical light ray, which has the reduced velocity.
These individual photon scatters are virtual in the sense of Feynman diagrams, the real photons being the ones detected, by the eye or a detector. They are elastic because the color does not change in clear glass ( lets keep it simple)
Elastic scattering means that the phases are retained and thus images can be transmitted.
If the scattering is inelastic, the de-excitations of the excited atom or lattice will lose the phase relation of the photons and thus images will not be transmitted.
A quantum mechanical way of looking at it is that the system "photon +lattice" is analogous to the system "photon + double slit" : The individual photons travel a larger path , measured from the center between the slits to the point on the detector. In transparent media there is one quantum mechanical solution that keeps the phases between the individual photons that build up the emergent light.