You could resize the canvas to fit the width of the image in pixels via JavaScript. Since you're using a canvas you are probably using JavaScript already so this should not be a problem.
See Resize HTML5 canvas to fit window, although not identical, a similar solution should work.