fixing resize bug, pixelSize has to be always >= 1