Compress Images with JavaScript in html5-supported browser