Javascript save image to path