Fix picture generation to avoid truncating the sides of the image for