Outputting image assets with flickity
If I understand the question properly, this should do it for you:

{% if entry.gallery|length %}
&lt;div class="main-carousel"&gt;
    {% for image in entry.gallery.all() %}
    &lt;div class="carousel-cell"&gt;
        &lt;img src="{{ image.url }}" alt="{{ image.title }}" /&gt;
    &lt;/div&gt;
    {% endfor %}
&lt;/div&gt;
{% endif %}