@Mersad Your thread has been moved to the Scripting section. Please use it for scripting questions in the future.
That's because your draw functions are being executed after DGS finishes its own drawing. You can either change your onClientRender event priority to high or set DGS renderPriority to low using dgsSetRenderSetting. Both will ensure that your draw functions runs before DGS render event, which should make DGS elements render above it:
addEventHandler("onClientRender", root, drawFunction, false, "high")
addEventHandler:
By the way, is there any particular reason for not using dgsCreateImage?