add solution for rotate image problem