"It has been said earlier that the TARDIS cannot travel to other universes", you say. But then again, the TARDIS has traveled to other universes. Mostly in the very same episodes where it was said to be impossible. It traveled to the parallel universe in Rise of the Cybermen/Age of Steel in series 2, and to the pocket universe where House lived in The Doctor's Wife in series 6.
What this tells is that that first, everything is wibbly-wobbly in Doctor Who, and rules are established only to be broken, hopefully in a dramatic and satisfying way. And also, to keep to in-universe explanations for a second, that while normally the TARDIS can't travel between universes, special circumstances - such as Torchwood's use of the Dalek void ship to link the universes in Army of Ghosts - can certainly create situations where it's possible. The Time Lord technology used in the painting is that special situation.