ROATE IMAGE problem solved with in-place implementation