simple image upload - refactor for JS