{% load i18n thumbnail %}

<span id="{{ object.slug }}" class="inline {% if object.pictures.count == 2 %}inline-ps2{% else %}{% if object.pictures.count > 2 %}inline-ps3{% endif %}{% endif %} {{ class }}">
  <span class="{% if object.pictures.count == 2 %}pictureset2{% else %}{% if object.pictures.count > 2 %}pictureset3{% else %}pictureset1{% endif %}{% endif %}">
    {% thumbnail object.cover.picture size crop="center" as im %}
    <a href="{{ object.cover.picture.url }}" rel="pictureset[{{ object.slug }}]" title="{{ object.cover.description|striptags }}"><img src="{{ im.url }}" alt="{{ object.cover.title }}" class="picture"></a>
    {% endthumbnail %}

    {% for item in object.next_picture %}
    {% ifnotequal item.picture object.cover.picture %}
    {% thumbnail item.picture size crop="center" as im %}
    <a href="{{ item.picture.url }}" rel="pictureset[{{ object.slug }}]" 
       title="{{ item.description|striptags }}">
      <img src="{{ im.url }}" alt="{{ item.title }}" class="picture">
    </a>
    {% endthumbnail %}
    {% endifnotequal %}
    {% endfor %}
  </span>
  {% if object.show_description_inline %}
  <span class="inline_description">{{ object.description|safe }}</span>
  {% endif %}
  {% if object.show_counter %}
  <span class="inline_counter">{% with count=object.pictures.count %}[{% if object.cover not in object.pictures.all %}{{ count|add:"1" }}{% else %}{{ count }}{% endif %} {% ifequal count 1 %}{% trans "picture" %}{% else %}{% trans "pictures" %}{% endifequal %}]{% endwith %}</span>
  {% endif %}
</span>
