Made orientation correction optional based on availablility of imagerotate() function in gd (missing from sone linux distros)