The gravitational redshift of photons traversing a collapsing dust