Modify set_boundary_pixels method