Set maxpixels based on dpi/width/height.