graph: add parent img refcount for faster rmi Upstream-commit: ce0457a2c9a2b946679c084acbdb69a81a8a4dc7 Component: engine