add in-place solution for rotate image problem