solved bug #654. 'SecurityError: The operation is insecure', when called canvas.toDataURL('image/png')