fix 1px problem and resampling