Captivity

A young man is being tortured. Two tubes are inserted into his nose, and truck battery acid is pumped in through one pipe, causing blood to pour out through the other. The man's captor then kills him with a large hammer.
Jennifer Tree (Elisha Cuthbert), a young fashion model and cover girl, had captured the attention of photographers and for better or worse, the public at large. On an evening out alone, Jennifer is stalked and drugged. She wakes in a stupor to find herself captive and confined to a cell. A series of metal bins and numbered lockers abruptly swing open in front of her. They contain personal items taken from her apartment. She is forced to view videotapes containing images of the victims who were tortured previous to her captivity, as well as videotaped interviews she had given to the media in the past. Realizing there is no way out, Jennifer pleads and screams to anyone who might hear her.
During her confinement, she is subjected to various forms of psychological torture. Jennifer eventually finds she is not alone. A young man, Gary (Daniel Gillies), is being held captive in an adjoining cell. The two make contact and try to find out why they are being held. After watching the horrific scene, they find their way out. They both make it to a garage where they find a car. As soon as they are about to start it, a gas erupts in the car making them both unconscious. They find themselves back in their cells where Jennifer sees a tape of Gary being taken and tied to a chair with a gun held under his chin. After a while of Jennifer worrying, she sees Gary being thrown into his cell. She rushes to him and helps him. After having consensual sex, Gary awakens to find Jennifer, who has been drugged once again. He takes out a key to an adjoining cell.
After Gary awakens he discovers Jennifer had drunk a bottle of water that had a drug in it to put her to sleep. He then gets up to wipe the blood off his nose, while he's leaving he makes sure Jennifer is sound asleep before leaving the cell. Gary's key opens a door into a house, revealing that Gary and his older brother Ben are actually the captors. Gary joins Ben in the kitchen where they make sushi. Gary tells Ben that he is falling in love with Jennifer. Ben then puts something in the fridge. When he turns around, Gary stabs him. Gary then watches the same tape of the woman lying on the bed that was shown earlier. The boy stabbing his mother is revealed to have been Gary looking at a smirking Ben. After the tape, Gary is seen reviewing a series of pictures in an album, and then there is a knock at the door. At the sound of knocks, he rushes to put the albums in a cabinet.
He slams the cabinet's door, but it does not fully close. The knockers at the door are two detectives looking for Ben. Gary tells them that his brother is not at home. The detectives enter the house, get comfortable, and ask to watch a big sports game on television. One of them flips the channel to the surveillance video of Jennifer sleeping. Seeing this, Gary shoots them both. He runs down to where Jennifer is being held and tells her that he has killed them and that it is time to go. He places Jennifer in a room and tells her not to go. One of the detectives, not dead after all, jumps out at her but she kills him with a bat, believing him to be one of her captors. Jennifer then discovers the partially open cabinet and begins viewing the albums. Gary is in all of them. While she looks through the albums, Ben, also not yet dead, jumps out at her. However, Jennifer finishes him off by stabbing the knife more deeply into him.
After viewing the albums, Jennifer hears the detective's pager ring and she goes through his personal belongings. Gary records Jennifer, who claims she belongs to him and will help him clean up the mess. She tricks him and sprays ammonia in his eyes before running off. On her way, she cuts a series of wires and electrical cords, which prevents doors, code entries and lights from working. Jennifer picks up a flashlight and the gun used on the detectives. She points the flashlight at the opposite wall through a poster of her, distracting Gary. Jennifer then goes through the door and points the gun at Gary. Gary then tries to persuade her to put the gun down. When its clear she won't, he lunges toward her with a pocket knife and she shoots him. Gary falls back and tries to lunge again but she shoots him a second time and he falls back on the bed. Gary whispers to her while gasping for air. Jennifer shoots at her poster which covered a window leading outside. She drops the gun and walks outside then down the street.

Question: Who shoots the detectives?
Answer: Gary