Your question is a perfect reason why students should never substitute a movie for a work of literature! The writers of screen plays and directors themselves change things in order to increase the viewing of their movie. This is definitely reflected in your question. Why? The details of the original work, The Picture of Dorian Gray, and the details of the movie you provide differ greatly. Let's look at each in turn.
First, let's look at the actual story, The Picture of Dorian Gray, along with its original ending. In short, the picture is revealed. The picture is grotesque, featuring blood dripping form a knife. This is all we see, in reality because it is a "crash" that is heard from the servants in other parts of the household. The next thing we are shown, as readers, is the original picture of Dorian Gray looking young and vibrant. In opposition, there is a shriveled, decrepit old man on the floor. He is dead and with a knife plunged into his heart. There is an effort made to identify the man. The only evidence that it is truly Dorian Gray is the rings that remain on his fingers. (Please note, neither Dorian NOR the picture is burned in the real story! In the original written work, there is no "later on" for him to see the painting in the future!)
Behind every exquisite thing that existed, there was something tragic.
Next, let's look at the movie that came out a few years ago. It is not called The Picture of Dorian Gray, but is distinguished from the original work by being called simply Dorian Gray. This change in title is appropriate because the ending is VASTLY different! This is the ending you refer to. More appropriately, it is the climax that is changed. In this version, Dorian Gray IS burned. The painting is burned as well. The stabbing happens only after Gray is faced with lethal fire. Then the resolution of the movie does show Henry traversing the attic and finding the painting. However, this is NOT what happens in the book!
In conclusion, it's important to note one similarity: the painting is stabbed. That is where the similarities end. Further, your quesiton is a very important one in that it should prove to students that reading the actual book is more important than watching a theatrical version.
The story of The Picture of Dorian Gray has been used in more than one hundred movies, plays, ballets, and episodes in television series. One of the more recent is the 2009 movie called Dorian Gray. In this movie the plot departs several times from the actual book.
One of those departures is the final climax when Dorian Gray is burned along with his painting. Like the book he does stab the painting, but it is only after he is facing death by fire. The movie ends with Henry revisiting the attic where the painting sits in its charred frame. The portrait of Dorian has returned to the youthful idyllic appearance.
Oliver Parker, the director, is indicating in the movie that even though the physical Dorian is dead, the paintings connection to his soul still exists- thus the painting is untouched by the fire- likewise in the book the painting is untouched by the knife. Whether by fire or by knife the allusion that the painting took on Dorian's sins but did not pay for them stands in this version.
There is some debate about why Toby Finley the writer of the 2009 deviated from the ending. One reason might be that he was a fan of the film American Psycho and commented in an interview that he wanted to look at Dorian Gray from that perspective. This required Dorian not to kill himself out of self loathing but out of self sacrifice and realization that is mocked by the situation at the end of the movie.
Dorian comes to realize that his beauty had just been vanity and nothing more. He longs for the innocence of his youth. He returns to his home and after looking in the mirror smashes the mirror. The living death of his soul troubled him. He pulls the cover off of his picture intent on turning over a new life. The thing in the picture looks at him. It is gruesome. It is holding a knife that drips blood. A cry and crash is heard by the servants. When the policeman and the servants enter the room they see a youthful beautiful picture of Dorian on the wall. On the floor lies a dead man shriveled, in evening dress. He has a knife embedded in his heart. They did not know it was Dorian until they identify the rings on the man.
That is the end of the book in summary. The picture is not burned by Henry nor is Dorian. The picture of Dorian is seen only on Dorian's wall and it is a picture of Dorian when he was first painted. Sir Henry is not in the room. (Final Chapter)