WordPress 4.9 introduced gallery widget which can be customised to show in sidebars.
To find the new gallery widget go to
Appearance > Widgets
We can choose or upload images from Media Library here.
Click on Add images. Select images from your media library and click on Create a new gallery.
In the next screen choose your gallery settings.
Click on Insert gallery. It will show gallery preview in the widget.
Saving this widget will show the gallery in where the widget is being displayed in front-end.