cleanup imgedit code