Output a default asset if one hasn't been specified I've looked at and tried a couple of solutions on here but struggling to apply them to my circumstance.

Below is my current code.  I would like a 'default' asset (image) to be used if one hasn't been specified by the admin.  This is so that the front end doesn't have gaps in the gallery.

&lt;ul id="photListing"&gt;
{% cache %}
  {% for entry in craft.entries.section('people').find() %}
  &lt;li&gt;
    &lt;a href="{{ entry.url }}"&gt;
      &lt;figure&gt;
      {% for block in entry.basicProfileInfo %}
      {% set varBarrPic = block.mx_peoplePhoto.first() %}
        &lt;img src="{{ varBarrPic.url }}" alt=""&gt;
          &lt;figcaption&gt;&lt;span&gt;{{ block.mx_positionWithinBusiness }}&lt;/span&gt; {{ entry.title }}&lt;/figcaption&gt;
      {% endfor %}
      &lt;/figure&gt;
    &lt;/a&gt;
  &lt;/li&gt;
  {% endfor %}
{% endcache %}
&lt;/ul&gt;


I hope this is a simple solution.

Many thanks

Martin
You can test if your first() method returns an asset model. 
And depending on that have different image URLs, the (transformed) asset's one or the URL of your placholder image.

{% set image = block.mx_peoplePhoto.first() %}
{% set imageUrl = image ? image.url('500x500') : url('images/_static/placeholder.jpg') %}

&lt;img src="{{ imageUrl }}"&gt;


You could also consider to get that placeholder image from a global set.