commit before changing document into image entity