title: Extending ImageChooserPanel to allow multiple selections and uploads
body: <p>I am thinking about migrating an existing webpage to wagtail. However, a major part of the page are image galleries, with a total of some thousand images and some hundred galleries. Furthermore, the page is divided into several sites, with editors only allowed to change the content for one specific site.</p>
  
  <p>Since the collections are not hierachical, they do not provide a convenient way to collect images into image galleries, the select boxes get confusingly long if their number grows. </p>
  
  <p>I have defined a <code>page</code>-derived class that contains <code>ParentalKey</code> to images, which is sufficient to implement an image gallery. However, it is not very user-friendly to select, say, 200 images for the gallery one by one. Thus I thought I should extend the <code>ImageChooserPanel</code> to something like a<code>MultipleImageChooserPanel</code>, which would allow selecting and uploading multiple images. The code for uploading multiple images should be available in wagtail. </p>
  
  <p>After reading the code for <code>wagtailimages/views/multiple.py</code>, <code>wagtailadmin/edit_handlers.py</code> and all the corresponding parent classes, I still do not see how the modal <code>ImageChooserPanel</code> determines the selected image and how its <code>id</code> is returned. Presumably, most of this happens in JS, however, I cannot find any hint where to look for the corresponding code, nor any hints on how to extend it.</p>
  
  <p>Is it possible to extend the modal <code>ImageChooserPanel</code>? Could anyone point me to a code snippet to start with?</p>