The image formed by a pinhole camera is always inverted. This is because of the fact that light travels in a straight line.The light rays from the top of the object travel through the center of the pinhole and go downwards.Similarly, the light from the top of the object passes through the center of the pinhole in a straight line and go upwards.Thus the image obtained from a pinhole camera is always inverted.