[WayUpSample] Image rotation fix, bug #19784