Remove unnecessary libraries and images.