How much storage are the photos taking up in iCloud and how much storage is available for the photos on your iPhone?
If you have too many photos in iCloud, even optimize storage will not work any longer. Optimize Storage can reduce the storage required for your photos on the iPhone at most by the factor ten (based on the user experience reported here).
For example, if the photos on your iCloud account take up 50GB, you will need at least 5GB of storage for your photos on your iPhone, or you will only see exclamation points and not even optimized versions.
If you should have too many photos in iCloud, try to save them to a computer and free storage in iCloud Photo Library, so photos will be removed from your iPhone as well.