Yes, if you use a travel SIM in your iPhone, you will still have access to your contacts and photos after switching back to your normal SIM card. Your contacts and photos are stored on your phone's internal memory, not on the SIM card itself.
When you change SIM cards, your phone number and cellular plan will be associated with the new SIM, but your personal data such as contacts, photos, and apps will remain on your device. When you return home and switch back to your normal SIM, your original phone number and cellular plan will be restored, and you will still have access to all of your contacts and photos.
To ensure the smoothest experience, make sure to backup your phone before your trip, either using iCloud or by connecting your iPhone to a computer and using iTunes. This will give you peace of mind in case anything happens to your device while traveling.