Of course it can work but you need to apply the right syntax.
I recommend to use the <b>foreach</b> statement instead of <b>section loop</b> but it works also with section loop.
You can do this for example :
{section <b>var=test</b> loop=fetch( content,
list,
hash( parent_node_id, $node.node_id,
offset, $view_parameters.offset,
sort_by, $node.sort_array, limit, 8) ) }
<i>And here you apply the test</i>
{if $test.data_map.IM.has_content}
{attribute_view_gui=$test.data_map.IM}
{else}
Your standard image {/if}