Fix #2666: release image properly when create icon