Add cleanimages function