fix loosing photos when save