First, you must skip class and try to find him in the bathroom or elsewhere, then help him to find his hat. His 3rd picture can only be unlocked when you take a picture of him with the camera in his room (which means you must go to his room in the Bellatrix dorm).