Using images in custom module (not through css)
If you want to access images in the module folder:

preprocess function (assuming page, but can be any other template):

mymodule.module:
function mymodule_preprocess_page(&amp;$variables) {
  global $base_root, $base_path;
  $variables['image1'] = $base_root . $base_path . drupal_get_path('module', 'mymodule') . '/images/' . $image1;
}


twig:

&lt;img src="{{ image1 }}" /&gt;


I don't know your logic for multiple images, I guess you have to code a loop for this.

But accessing static images in a module folder is not a cms way to do this, I would put the images into a node. You can make a content type "slider" for this and then access the absolute path of the image field:

twig:

&lt;img src="{{ file_url(slider_node.field_slider_image.0.entity.uri.value) }}" /&gt;


Here you can code a twig loop to access multiple images in the field.