Pictures support EXIF information including orientation. Most phone cameras and editors will tag a picture with this orientation setting rather than flipping the picture around itself (to avoid recompressing too many times and lowering the quality). But not all browsers know what to do with this information.