Ib is one of my favorite games and I'm pretty sure I've played every ending...
>>3 to get that ending you first need to let Garry die and then burn Mary. After that when you try to go through the Fabricated World painting a fake Garry should appear. Haven't played the game in a while so my explanation might not be that accurate...