Remove unused images and draw a background.