Enable iCloud Photos along with My Photo Stream so that your Photos from My Photo Stream are uploaded to iCloud automatically. If you already have then there is nothing to worry about. See the pic below
"My Photo Stream uploads your most recent photos (except Live Photos) so that you can view and import them to another device if you like. Photos are stored in My Photo Stream for 30 days and then are deleted from iCloud. To keep your photos stored in iCloud on an ongoing basis, set up and use iCloud Photos. iCloud Photos uploads all of your photos and videos to iCloud and keeps them up to date across your devices.
If you turn on both My Photo Stream and iCloud Photos on an iPhone, iPad, or iPod touch, photos that you take with that device upload to both iCloud Photos and My Photo Stream.
If you use another device with the same Apple ID that has only My Photo Stream turned on, photos that you take on that device upload only to My Photo Stream. They don't appear on any devices that have only iCloud Photos enabled."
Learn more about the differences between iCloud Photos and My Photo Stream.