That is interesting the PI ignores HTML. Yes, unfortunately, you cannot just place tags wherever you want. The image tag does not accept the data tag as a child. What about swapping the roles of the caption and data tag. Use the caption with imge_src and the data tag with caption?
PI doesn't ignore HTML, it just selectively accepts it. Usually if you use <format></format>, it accepts most HTML, but I forgot to mention it earlier. Not sure if it works inside caption tags, though.