added AJAX callback to override the image, changed JS accordingly