here is the code for an example I built that uses subforms one with square textfields one with round
form1.fg.DropDownList1::change - (JavaScript, client)
var yug
var jug
var gug = (yug + jug)
if (xfa.event.newText=="square")
{xfa.form.form1.fg.flw.sqr._sqr2.count = (yug)
xfa.form.form1.fg.flw.sqr._sqr2.addInstance (1)
xfa.form.form1.fg.flw.sqr._sqr2.moveInstance (gug + 1) }
if (xfa.event.newText=="round")
{xfa.form.form1.fg.flw.rnd._rnd2.count = (jug)
xfa.form.form1.fg.flw.rnd._rnd2.addInstance (1)
xfa.form.form1.fg.flw.rnd._rnd2.moveInstance (gug + 1)}
xfa.form.recalculate(1);
you could use something like that but instead use
image field and a text field in your subforms