Safe editing of images