Resize images proportionally on the client side before upload