def METHOD_NAME(self, context):
    layout = self.layout
    wm = context.window_manager
    row = layout.row()
    row.prop(wm, "my_previews_dir")
    row = layout.row()
    row.template_icon_view(wm, "my_previews")
    row = layout.row()
    row.prop(wm, "my_previews")