We have run into the same problem in a client project. This has caught our attention since accessibility concerns are gaining traction, particularly ones regarding images. It would be nice to have this solution included in Core, to continue the efforts that have already been put in place to improve Drupal's accessibility.