Removes unnecessary images.