Hitting enter crops the image

This seems to work, but I'm not javascript expert.