Change to JPEG format, make format configurable.