serialize image only on edit