Fix toDataURL not honoring format. Thanks ebirbal.