Group looped entries into blocks and wrap in markup every x number of loops
The array slice something you are looking for is Twig's batch filter. Here's how you'd set up the groups and use loop.index to generate the class name.

{# Use the `find()` method to return an array of EntryModels #}
{% set selectedWork = craft.entries.section('selectedWork').find() %}

{# Group entries using the `batch` filter #}
{% set selectedWorkGrouped = selectedWork|batch(9) %}

{% for group in selectedWorkGrouped %}

    {# Set class using the loop index from outer loop #}
    {% set panelClass = 'panel--' ~ loop.index %}

    &lt;div class="panel {{ panelClass }}"&gt;

        {% for entry in group %}
            &lt;section class="img-grid__item"&gt;
                {{ entry.title }}
            &lt;/section&gt;
        {% endfor %}

    &lt;/div

{% endfor %}