If you can’t upload your images to product. And you get this error: {Object}.toJSON is not a function in firebug console. This issue will be fix easily if you add $H() to your object.
replace by:
var myData = this.images.toJSON();
replace by:
var myData = $H(this.images).toJSON();