improvements for the pixel iterator for selections with polygons. this works but it is a temporary solution as it may fail  in some cases