Hello,
If you are simply looking to return the parentID of the given node to use to obtain the image you can use
<%# CMS.CMSHelper.CMSContext.CurrentResolver.ResolveMacros("{%cmscontext.currentdocumentparent.nodeid%}") %> which will return the currently viewed documents parent node ID, or <%# Eval("nodeParentID") %> which will return the parent id of any document. If you need to select more information for your transformation, you need to create custom transformation
function for this purpose. Then, you can use “NodeParentID” [ Eval(“NodeParentID”) ] as input variable in your custom transformation function. Then you can get any information from parent node in code of your custom function when getting TreeNode object from NodeID (in your case from ParentNodeID) and return any information from parent Node.