The code is 473. This guide explains how to get there without that knowledge.For a while I was confused because I thought I was supposed to go to one painting and to the next and when I reach the last painting I would see some sort of clue. But in fact each painting has a number on it.
The sequence is the sequence of paintings given: The crowded street (4) which is on the bottom floor near the entrance, then the anchored whaleship (7) which is in the top floor in the walkway between the stairs and the room and last the slaughterhouse (3) which is on the second floor in the walkway between the stairs and the room. The safe is on the top floor.