Patch border to have at least one pixel.

We check that we have a border of at least 1 pixel in 8-neighborhood.