How can i set media attachments to the author of the post or page for already existed posts with attachments

I have been uploading posts for multiple authors in my site and the attachements (photos) are registered all in my account.

Is there a way to set the attachements to have the author of the post ?

I found this How to set author for post AND post attachments but it only works for new posts. Is there a solution for the already published posts?