iCloud Photo Library is a perfect service for storing and accessing your iPhone Photos. But if you wish to sell or give the iOS device to someone else, you need to take a few precautionary steps to avoid unpleasant surprises. The necessary procedure for such deals consists in removing all photos from the previous owner’s (or user’s) iCloud Photo Library with the confirmation for deleting the images from all synced devices. Only after such a wipe-out, will the new owner use the iOS device smoothly.
Many Mac users have experienced unexpected happenings when the previous owner left himself or herself logged in before the handover. It appeared impossible for the new owners to simply delete previous owner’s images (they remained in old owner’s iCloud account).
Remember that turning off iCloud Photo Library on one device does not delete the images from iCloud, so long as iCloud Photo Library remains turned on at any other device. So, the deleted photos will remain in iCloud.
It is a bad idea to sell (or buy or hand over) an uncleansed phone because any applications purchased or downloaded from the App Store that are on the device remain registered to the previous owner. In case of a handover, you need to head to Settings, and then follow to General > Reset > Erase All Contents and Settings. Otherwise, since the login checker mechanism is unaware that the device changed hands, in many cases new owner will be asked for previous owner’s login.
In the worst case, you can get entangled in the unfamiliar images and settings and even may undeliberately upload your own personal images to someone else’s iCloud Photo Library.