Throw the container with the animals away - and keep the next batch in a:
Put your flour and cereal in a container with a tight fitting lid, something like tupperware. That way they can't get in. In dog and cat food, freeze the food over night. same with Indian meal moths, they are about an 1/8 inch wide, 1/2 inch long.