Just a theory here,
What if because he drank that potion in the bowl while looking for hte locket that his soul left his body. his body died, but his soul would still be alive, but without a host body, thus causing the painting to appear, but dumbledore not dead. he then will come bak as a ghost, becuase his soul did not die and help harry out.
I just hope umbridge will not become headmistress now like she did in order of the pheonixs