add part of new solution for rotate image