refactored XMLHttpRequest saving image to server as  service
refactored XMLHttpRequest saving image to server as  service