modified controller and moved cropping script to _form.