Fixed line padding logic so that images with 0 padding are displayed properly.