Resize image to fix canvas error in Firefox