added code to deal with saggital images