Use the correct depth when creating the XImage.