Hey Pughma,
Thank you for using the Apple Support Communities! We understand you want to disable the option that automatically saves photos you receive in Messages. We're happy to help.
We can see your profile shows you're using an iPhone with iOS 15. Based on your description, it sounds like you could be referring to the new Shared with You feature that is part of the new features iOS 15 brings to your device. This can be disabled.
Check out 'Use Shared with You' in Use Messages on your iPhone, iPad, or iPod touch. We've quoted this section for you below, as well.
"With iOS 15 and iPadOS 15, content that's shared with you in the Messages app is automatically organized in a Shared with You section in the corresponding app. Shared with You works with Photos, Safari, News, Music, Podcasts, and the Apple TV app.
Content that's shared with you is labeled in the corresponding app, so you can see who shared the content with you. With a simple tap on the name, you can easily reply to the share and continue the conversation in Messages.
To disable Automatic Sharing or a certain app from using Shared with You, go to Settings > Messages > Shared with You, and turn off Automatic Sharing or the app.
Learn more about finding and sharing content with Shared with You."
Best regards.