I have noticed some confused thinking here related to taking photos while on the job.
If you take photos, while working for an employer, you, as the photographer still own the copyright and the photos, unless you were specifically hired by Walmart or whatever company to take photos or signed a specific contract giving them the rights to your photos.
To use another example, a teacher while working for a school district, takes photos at a sports event. The teacher has not been hired to take photos and paid separately for completing that task, so he/she owns the photos and the copyright despite being on school district time when the photos were taken.
Even if you are hired as a photographer, you usually work on a contract that states that you retain the rights and ownership of any photos not used for the particular assignment.
Bottom line is that unless you are paid specifically for the photos or for your work in taking them, they are yours, despite whether you took them while working on another non-photographic job.
Ronnoco