To add attachments on chat, you have to use showAttachmentButton="true" and add a few lines, described in COMPONENT_MESSAGE_INPUT.MD
Then I found this example, which images are hardcoded using ArrayList. But how to actually attach images selected by user? I couldn't find any example to do that.