http://zocada.com/compress-resize-images-javascript-browser/