Handle downsampling with the downsample.js utility to get scaling right