Proper disposing of opened images