smart image rotation added