JPG compression for inline pylab

This is a follow up to #4448

It adds JPG compression and quality options to render inline figures. This is useful for blogs where PNG isn't compact enough and SVG overly-verbose.