Images are not showing up in “Uploaded to this post”

When you upload an image within the post edit screen, the image gets the parent id that of the post id you are editing. In this case if you check the Media Library screen, you will see the post mentioned under Uploaded To column against that image.

On the other hand if you directly upload an image from Media Library screen, then there will be no post mentioned against that image. Rather you will see Unattached under Uploaded To column for that image.

You can use the Attach link against that image and select the post you want to attach that image to. After that if you check in the edit post screen, you will see the image on selecting Uploaded to this post option.