<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def admin_docker_massaction_view(context, request):
 """Mass action view."""

    items_list = request.POST.getall('selected_item')
    for item in items_list:
        try:
            context.cli.remove_image(item)
            request.session.flash(["deleted {}".format(item), "success"])
        except docker.errors.APIError as e:
            request.session.flash([e.explanation, "error"])
    url = "/" + request.sacrud_prefix + "/" + resource_path(context.__parent__)
    return HTTPFound(location=url)