TL;DR Summary:
Is there some way to measure the width of a leaf node and pass this measurement back up the tree to be used in setting sibling distance? (One might want to do a similar thing for level distance as well.)
Example:
Suppose that I have a simple tree where the leaf nodes each contain the same image:
\documentclass{standalone}
\usepackage{tikz}
\pgfdeclareimage{image}{fptp-ballot}
\begin{document}
\begin{tikzpicture}
\node {root} [level/.append style={level distance=4cm}]
child foreach \c in {1,2} {
node [fill=red!10] {\pgfuseimage{image}}};
\end{tikzpicture}
\end{document}
With the default setting for sibling distance, the leaves overlap:

One way that we could measure the width of the leaf is to create an invisible temporary leaf, tmp, and use the let operation for paths to compute its width:
\documentclass{standalone}
\usepackage{tikz}
\usetikzlibrary{calc}
\pgfdeclareimage{image}{fptp-ballot}
\begin{document}
\begin{tikzpicture}
\node (tmp) [fill=red!10, transparent, overlay] {\pgfuseimage{image}};
\path let \p{leafwidth} = ($(tmp.east)-(tmp.west)$) in
node {root} [level/.append style={level distance=4cm, sibling distance=\x{leafwidth}}]
child foreach \c in {1,2} {
node [fill=red!10] {\pgfuseimage{image}}};
\end{tikzpicture}
\end{document}

The problem with this approach is: It seems clumsy to need to create a temporary leaf, tmp, when the leaves that I really want to measure already exist later in the code. This makes things less modular. If I change the leaves, then I need to change the tmp node correspondingly (or factor out the leaf code with a macro and style).
In other words, I'd like a solution that works locally regardless of what I put inside the leaves -- a single image, a matrix with arbitrary cell content, etc.
Question:
Is there some way to directly measure the width of an actual leaf node and pass this measurement back up the tree to be used in setting sibling distance?
I would like to write something like the following:
\begin{tikzpicture}
\node {root} [level/.append style={level distance=4cm, sibling distance=\x{leaf1width}}]
child foreach \c in {1,2} {
node (leaf\c)
[fill=red!10] {\pgfuseimage{image}}
let \p{leaf\c width} = ($(leaf\c.east)-(leaf\c.west)$) in};
\end{tikzpicture}
Here I am directly measuring the widths of the actual leaves and am trying to use this to set sibling distance at the root node. Unfortunately, this gives the error "Undefined control sequence. <argument> \x{leaf1width}", presumably because \p{leaf\c width} is not defined until the leaves are reached. Is there any way to fix this code?
I thought about using the late options key, but the TikZ manual states that
An already existing node is determined [...] and, then, the options are executed in a local scope. Most of these options will have no effect since you cannot change the appearance of the node, that is, you cannot change a red node into a green node using late options.
Indeed, the following compiles without error, but the sibling distance is not affected.
\begin{tikzpicture}
\node (root) {root} [level/.append style={level distance=4cm}]
child foreach \c in {1,2} {
node (leaf\c)
[fill=red!10] {\pgfuseimage{image}}
let \p{leaf\c width} = ($(leaf\c.east)-(leaf\c.west)$) in
(root) [late options={level/.append style={sibling distance=\x{leaf1width}}}]};
\end{tikzpicture}
