One way to tackle this issue is by implementing a technique known as double buffering. I encountered a similar issue and managed to resolve it by utilizing a hidden canvas buffer. Prior to resizing, you can duplicate your original canvas onto this buffer, adjust the size of the original canvas, and then re-draw from the buffer.
Here's a practical example showcasing this approach:
http://example.com/double-buffering-demo/
var canvas = document.getElementById('canvas'),
buffer = document.getElementById('buffer'),
context = canvas.getContext("2d"),
bufferContext = buffer.getContext("2d");
bufferContext.drawImage(canvas, 0, 0); // Copy canvas to hidden buffer
canvas.width = 50; // Resize canvas
context.drawImage(buffer, 0, 0); // Redraw from buffer to canvas