Fix corrupt image attempting to pad planar image.