fix: #3628779 Preserve image formatter services on serialization

Both image formatters lose injected services when serialized. Make the four service properties protected so Drupal can restore them, and add a Kernel regression test covering both formatters.

Tested on Drupal 10 and 11: both cases fail before the fix and pass afterward. Verified compatibility with the existing caption/token MRs. The new test passes Drupal coding standards.

Issue: https://www.drupal.org/project/glightbox/issues/3628779

AI-Generated: Yes (Codex prepared the fix and regression test.)

Merge request reports

Loading
Loading