added more behavior to image upload