Fixed image rotation issue with jpeg files