resize image with javascript before upload
added method in controller to save image via ajax