Resize an image with the click and drag event in javascript