Most likely your pictures are in the JPEG format (.jpg or .jpeg).
JPEG supports a 3 bit rotation information to allow displaying the picture in the correct orientation, and all up-to-date cameras (maybe except the very simple ones) detect the camera orientation when the picture is taken such that the bits are set correctly. Unfortunately, there still seems to be software that does not care - sadly, the built-in Windows Photo Viewer is probably the most prominent example. Note that this is a feature of the file itself and does not depend on the API. Rotations done after uploading, however, cannot be reproduced outside geocaching.com. Unfortunately the only way to be really sure is to ensure that your files are natively displayed in the correct orientation (there are lossless tools doing so - using the Windows Photo Viewer rotation function is highly destructive!), and the rotation flags cleared after that so there can no longer be confusion.