fixed bug where parent_id is removed when image is updated