The pinhole camera is the simplest kind of camera. The image formed by a pinhole camera is always inverted and smaller in size when compared to the original object.
But we can not see the image of the sun as inverted because it is spherical in shape and highly symmetric.
Hence, inverted image of the sun looks the same as the image is upright.