Thanks for your additional information.
If you attach a media file to a post on the Media page > column Uploaded To, that means the post is set to the parent post of the media file (find in the column post_parent, table wp_posts)
This is not a post meta so it is not possible to create a custom field to assign those values to the field and display images when editing the post. You need to create a field like
image_advanced and select images manually.