fixing edit function

if select image will replace image, else will update content only