Like it or not the texture loader worked by accident.

Quote from opengl.org:

glGenTextures returns n texture names in textures. There is no guarantee that the names form a contiguous set of integers: however, it is guaranteed that none of the returned names was in use immediately before the call to glGenTextures.
Removed safe and unsafe texture loading distinction.
Flopped all textures.
Fixed bottom up handling.