How can I dynamically get the fields on an image media bundle?
You can traverse the field definitions of the media bundle image and look for a field with the type image:

$fields = \Drupal::service('entity_field.manager')-&gt;getFieldDefinitions('media', 'image');
foreach ($fields as $key =&gt; $field) {
  if ($field-&gt;getType() === 'image') {
    // found image field $key
  }
}


To get all media bundles:

$bundles = \Drupal::service('entity_type.bundle.info')-&gt;getBundleInfo('media');