Replaced "or throw new" with if checks, changed defaults resize mode.
Better API for setting JPEG compression quality