title: Shopify - Conditionally using variant image as thumbnail if available
body: <p>Is there a way to use variant image as thumbnail if available? For example, I have a product that comes in Black, Blue and Red, and successfully associate them with specific image. How do i get those images as list item and using just standard featured image if color variant isn't available? Here's the scenario for help:</p>
  
  <pre><code>{% if variant color is available %}
      &lt;ul class="variantimage-on"&gt;
          &lt;li&gt;Black Image&lt;/li&gt;
          &lt;li&gt;Blue Image&lt;/li&gt;
          &lt;li&gt;Red Image&lt;/li&gt;
      &lt;/ul&gt;
  {% else %}
      &lt;ul class="variantimage-off"&gt;
          &lt;li&gt;&lt;img src="{{ product.images.first | product_img_url: 'grande' }}" alt="{{ product.title }}" /&gt;&lt;/li&gt;
      &lt;/ul&gt;
  {% endif %}
  </code></pre>