Hi, I get how concerning it is to see your photos get damaged after marking them as favorites.
What’s happening is the Photos app writes metadata back to the image when you click the heart, and in the latest Windows 11 24H2 build, that process is corrupting certain JPG files.
The quickest way to prevent more issues is to avoid favoriting those images for now, then update the Photos app through the Microsoft Store and repair or reset it under Settings > Apps > Installed apps > Photos > Advanced options.
You can also try Photos Legacy or another viewer for tagging until Microsoft releases a fix.
Can you check if this only happens with JPGs or also with PNG/HEIC, and whether the affected files were edited before?
That will help narrow down the cause.
Regards,
Aron