Some pictures transferred by cable from a computer to an iPhone are treated as temporary, and the expectation is that the originals are still on the computer. So these "From My Mac" pictures can't be edited, printed, or deleted on the phone, and they can't be synchronized with iCloud Photos. If you don't still have these in your Mac Photos Library, then Matti Haveri's suggestion is exactly right-- to keep them you need to get them under the control of the Photos app. This applies to as well to other pictures that aren't completely controlled by Photos.
As Matti suggests, since you have a Mac, you may be able to use the app Image Capture from your Applications folder to transfer the pictures to your Mac and to Photos. This seems like the best bet. Be careful to make sure you get all the ones you want to save-- sometimes Image Capture may miss some.
Or you can use the iPhone to save them to Files and then re-import them to Photos. You can use Files>iCloud Drive or or Files>External Drive. If you use Files>On My iPhone, then you'll want to delete them after you're sure they are safely in Photos on your Mac or iPhone.
If you do still have these pictures on your Mac, and if they won't upload to iCloud, then you should try to export them and then re-import them to Photos on the Mac. If you have them on the Mac and they won't export, then we might be able to help--maybe.
Let us know how it goes…