removes unnecessary images