Every photo upload, whether it comes from chat, profile, post or gallery, goes through the central Media/Gallery system.
The photo enters the user's personal media library. The user may choose which gallery it belongs to, what status it has and whether it is public, private, protected, owner-only or shareable according to the rules.
A user may have more than one gallery. The main gallery is not the only gallery. A gallery may have default rights and a specific photo may have its own rights.
Being able to view a photo does not automatically mean being allowed to share it. can_view and can_share are separate rights.
If the same photo already exists, the system avoids unnecessary re-upload. This does not change ownership, does not reveal who else has it and does not bypass private, protected, owner-only or policy restrictions.
media
Photos, galleries and sharing
How photos, galleries, rights and reuse work.