I have an issue with my Nikon D3500 camera which I do not understand. I can show it best using two photos I took with different settings. The lens I use is a kit lens which ranges from 18 to 105 mm.
This is photo #1: it has an F-number f/29, an exposure time of 1/160, and a focal length of 34 mm.
Image resized. Click the image to view in full size (6000x4000)
From photo #1 you can clearly see there are small black spots on the picture that should not be there. So I thought that it must be an issue with the sensor of the camera and I need to go get it cleaned.
However, here is photo #2 (the same scene with different settings): it has an F-number f/4.2, an exposure time of 1/4000, and a focal length of 34 mm.
Image resized. Click the image to view in full size (6000x4000)
In photo #2 you can see that the spots seen in photo #1 are no longer there. For context, I took these two photos in Aperture priority mode, so the only setting I changed was the F-number.
This pattern, where the greater the F-number, the clearer the spots on the photo is something which I have consistently noticed in all my photos. So my question is, what could be the issue with my camera where these spots appear at only large F-numbers?