Add a callback to allow for custom quality/width calculation

Changed into a callback as suggested.
Also aligned the default quality settings.

So for higher dpr, lower the quality.