Add a callback to allow for custom quality/width calculation