gpui: Fix out-of-bounds panic rendering GIFs (#54701)

Clamp the cached `frame_index` of an `img` element when the underlying
image changes so a stale index from a previous, longer animation cannot
index out of bounds on the new image.

Release Notes:

- Fixed a panic when a GIF was replaced with one that had fewer frames
in Markdown Preview.
749fcfdfd8Smit Barmase committed on 4/24/2026, 9:46:50 AM· committed by GitHubparent6bf0080
1 file changedLine totals unavailable