added orientation changing for 16bpp images