Derivation of the time dilatation effect from fundamental properties of photons