The option inherit causes the function to search the 'pictures' fields of the parents should the current content not have any.
{dynamic}
{getfield field=pictures inherit=true pick=random var=background_picture}
<img src="{$background_picture.file|escape}" alt="{$background_picture.legend|escape}" />
{/dynamic}