Javascript Rotate Image Before Upload