One could write a very extensive answer on that, but I will try to break it down to your particular question. Just to be sure this detail isn't missed: -ung and -en are derivative suffixes, the morphological root of Bild/bild-en/Bild-ung/ein-bild-en/… is definitely -bild-.
It is safe to assume that Bildung (= 11th century OHG bildunga) was long ago derived from bilden (= 8th century OHG biliden/bilidōn) by the still productive suffix -ung(a) (see also here). At that time, however, bilden chiefly meant to form and did not at all mean to educate.
The verb biliden/bilidōn ('to form, to replicate') and the noun bilidi ('form, image') are both older than the first written records of the German language, so no common ancestor is attested, but their form and meaning are arguably close enough to suppose they have the same root.
If the reconstructed PIE root biliþī is accurate, it would definitely be close enough to biliden/bilidōn and bilidi as well.
All these forms only meant something along the lines of '(to) form, (to) image, (to) model'.
The most important change
…happended not before the middle of the 18th century when the term bilden ('to form') was applied to the classical humanistic education ideal of 'forming' young people. As bilden became popular as a metaphor for to educate, the noun Bildung got its present-day meaning and popularity.
This late shift of meaning explains why they mean seem unrelated at first. But until about 1750, Bildung meant 'image making, forming', thus the relation to Bild ('image, form').
And today, Bildung can still mean 'creation, formation'. Contemporary examples:
ein Team bilden
to form a team
Teambildung
team formation
eine Schlange bilden
to queue/line up (literally: to form a snake)
bildende Kunst
visual (~imaging)/plastic arts (not: educating arts)
Staatsbildung
nation building