Update canvasResize.js

Adding input option keepRatio and maxSquareSize.

You can use them together to make you image fit within a square with maxSquareSize x maxSquareSize and keep the original width/height ratio.

Fixing bugs for iOS sub-sampling for larger image.