infants

Verification of a Hadith

Q: I recently heard a hadith that the infants and the people to whom the mesage was not sent will be tested on the last day with the commands of a messenger who will tell them to enter hell. People who will enter hell will be successful. But there is another hadith that infants will not enter jannah without taking their parents with them and they will enter jannah. Don't these two hadiths contradict? Is the first hadith authentic? If not what will happen to people whom the message is not reached in this world?