Erroneously duplicated the autorotateImage function