Added polygon to mask conversion