Heya;
All you gotta do is to go to the page of a pet -any pet-, and replace the number in its URL with the ID you are looking for.
For example, let's take this one of yours:
viewpet.php?id=291055436The number at the end, '291055436', is this pet's ID number. So if, for example, you're looking for the pet with ID#1, you simply put it like this:
viewpet.php?id=1Pet IDs cannot start with a 0, but apart from that, the only limitation is that the pet with that number must already have been created. So if the number is higher than the amount of pets that already exist, you won't find it either. Sometimes an ID can also be taken up by a deleted pet, so if a lower number gives you an error, that's why.
It's also worth noting that not all pets belong to an account, as off-account adopts are also assigned an ID. A lot of pets from 2008 and 2009 do not belong to accounts, so the lower the number, the higher the likelihood that the pet is account-less or even stuck on an inactive account.
Hope that answers it!^^