While deriving time dilation using the two postulates of Special theory of relativity we imagine that a light pulse is traveling back and forth between 2 mirrors. In the rest frame (when the observer and this arrangement share the same inertial frame) the figure looks as follows. The velocity of light is taken to be $c$ according to Einstein's second postulate
When this setup is moving towards right with respect to the observer with velocity V, then the figure looks as follows.
Here also we consider the velocity of light as $c$. But we observe that the path of light is not precisely vertical as in the first picture. The path of light is bent towards the horizontal direction. Hence path length has increased and to compensate for this increased path length it comes out that the time is dilated.
What I do not understand is that why the path of light is bent towards horizontal direction? I think that once the light pulse emerges from lower mirror, it is free from the influence of the lower mirror and will move straight up precisely in vertical direction in the space between the mirrors. Why it bends so that it can be reflected precisely form the middle of the upper mirror? According to my assumption the figure would look as follows.
If I consider velocity of light to be c then according to my figure there will be no time dilation.
I know that some where I am committing a mistake. I am following Einstein's 2nd postulate by taking velocity of light as c. So I think somehow I am violating Einstein's 1st postulate. But how? Is it that by keeping the light path precisely vertical I am actually allowing a frame of reference at absolute rest where light moves and such a absolute rest frame does not exist according to Einstein's 1st postulate?