Change Z-index With Action

This can be done easily with CSS – you can look at the Classify plugin by @julienallard1 to assign your bubble element to a class (🔥 Classify 4: A tiny plugin that brings CSS classes and +)

The code would look something like Z-index: -1; for the image on the bottom, and Z-index: 0; for the image on top. You could also look into css documentation to do more with it.