adding code for inplace rotation that takes multiple channels into account for an image