Removing unnecessary images