If you replace the lens with a pinhole (like a camera obscura) and think of the rays going straight from the subject through the pinhole to the film or sensor, it is apparent that light from upper right of subject lands on the lower left of the film, and so on, so the image is upside down and backwards when seen from behind.
The lens doesn't change that behavior, it just moves the rays around a little to make better images - a lens is basically a fancy pinhole that someone put costume jewelry bling into.