Made some changes specefict to 4 channel images. Fixed step value for tptr