The problem is that you probably doing it all fully on the client side.
I would advise to use HTML5 Canvas element. Please see this minimal manual:
http://www.html5canvastutorials.com/tutorials/html5-canvas-image-crop[
^].
Your solution will require a lot more, but handling the images is the key. Explaining all the aspects of such behavior would require too much time and space to fit this
Quick Questions and Answers forum format.
—SA