Any thoughts on what could fix this issue?
Hard to say without seeing the script, but you should try opting for a different approach to set the desired picture item.
/ ontrialend = [if(dropdown.geslacht.selectedvalue) picture.aat_avatar.item.1 = getitem(picture.aat_avatar, dropdown.geslacht.selectedvalue+1)]
is weird anyway, because it's circular: You set the 1st item in <picture aat_avatar> by pulling an item from that *same* picture element. Question is what was the 1st item before that? Anyway, If I were you I'd just do
<values>
/ selectedgender = 1
[...]
</values>
<picture genderpic>
/ items = ("Female.jpg", "Male.jpg")
/ select = values.selectedgender
[...]
</picture>
<dropdown getgender>
/ options = ("Female", "Male")
/ optionvalues = ("1", "2")
[...]
</dropdown>
and then
/ ontrialend = [values.selectedgender=dropdown.getgender.response]