Move the mipmaps selection code in the texture loading functions

Signed-off-by: Harm Hanemaaijer <fgenfb@yahoo.com>