Are the layers from the InDesign file preserved?

The fields of a template will be placed by default in alphabetical order (according to the internal name you have chosen): 
The layers will appear according to the Indesign file (knowing that layer N.1 normally corresponds to layer N.0 in eDocBuilder). The layers can be managed in the "Stacking order" option:  
This indicates the overlay of the text or image in relation to an image or other object. Options:
-1 = under the master PDF
1-100 = normal fields
101-110 = overlaid fields
(In Interactive templates, these fields cannot be modified by the user and always appear above the user added fields).
In fact, there is an option called "Stacking Groups" that allows you to create a relationship between fields, so that a field can slide up, down or disappear if another field is left empty, for example. For more details, you can refer to this article:
Alternatively, you can ask the user to make a selection from a drop-down menu for example, and based on that selection, an image field will be filled in. You can see here how to configure it:
However, you can change an image in your template based on a field value in a data file. For more information, please see this article: