Consider the below figure, to understand how this happens. From point P two rays appear, hit the mirror surface, and reflect into the eye of the observer. Notice that we use reflex law to create the reflected rays. If the reflected rays behind the mirror are projected backward (see the dotted lines), they appear to start from point Q. It is where the point P image is located. If we repeat this process for P'P, we get the picture at Q'. By using simple geometry, we can understand that the height of the image (the distance from Q to Q') is equal to the height of the object (the distance from P to P'). We obtain an upright image of the object behind the mirror by generating images at all points of the object.
[Image to be added Soon]
Note the reflected rays appear to be coming straight from the picture behind the mirror to the observer. In fact, these rays come from the points where they are reflected in the mirror. The image behind the mirror is considered a composite image since it can not be projected onto a screen — the rays tend only to come from a particular location behind the mirror itself. You can't see the picture if you step behind the mirror, so the rays don't go in there. However, the rays behave exactly as if they come from behind the mirror to the front of the mirror, so that is where the virtual image is centered.
We address actual images later; a true picture can be projected onto a screen since the rays are physically moving through the picture. Certainly, you can see pictures both actual and virtual. The difference is that it is not possible to project a virtual image onto a screen, while a real image can be projected on a screen.
Locating an Image in a Plane Mirror
The law of reflection tells us the angle of incidence is equal to the angle of reflection. Applying this to PAB and QAB triangles, using simple geometry we can deduce that they are congruent triangles. Hence, the distance PB between the object and the mirror is the same as the distance BQ from the mirror to the image. The distance of the object is the distance between the mirror and the object (or, more precisely, the center of the optical feature that produces its image). Similarly, the image distance is the distance between the mirror and the image (or, more precisely, the center of the optical element that produces the image).
If we calculate distances from the mirror, the object and the image are in opposite directions, so the object and image distances should have the opposite signs for a plane mirror. An extended object such as the container can be viewed as a set of points, and we can use the above method to locate the image of each point on the extended object, thus creating the extended image.