delete unused imgs, optimize used ones