fixed bug in js (when clicking next or prev rotVal was not reset)
fixed bug in content-type: image/jpg was sent when image/jpeg was
expected