respect the outputBytesPerLine parameter 

if it's longer than the natural length of the PNG file