WASHINGTON (CNN) -- The Senate passed by unanimous consent Wednesday a bill that would prevent the release of controversial photos of alleged U.S. abuse of prisoners and detainees.

Sen. Lindsey Graham says if necessary, the White House will classify the photos to keep them out of the public eye.

The bill, sponsored by Sens. Joe Lieberman, a Connecticut Independent, and Lindsey Graham, a South Carolina Republican, had originally been part of the war funding supplemental bill passed Tuesday by the House.

But House Democrats stripped that part of the measure from the bill, and the senators proposed it as stand-alone legislation.

Earlier Wednesday, Graham said at a Judiciary Committee hearing that he had received assurance from White House Chief of Staff Rahm Emanuel "that the president will not let these photos see the light of day."

"The people involved in Abu Ghraib and other detainee abuse allegations have been dealt with," Graham said, arguing against the release of the photographs. "Every photo would become a bullet or IED used by terrorists against our troops."

Hundreds of photos allegedly depict explosive images of prisoner abuse -- images U.S. military leaders believe would fuel anger in the war regions and endanger U.S. troops.

After receiving the White House promise, Graham agreed to release a "hold" on key legislation, including the $106 billion war funding measure.

Before the Senate vote, Graham told his colleagues from the Senate floor that President Barack Obama "would sign ... an executive order" classifying the photographs unless Congress acted to prevent their release.

The ACLU has gone to court to argue for release of the photos under the Freedom of Information Act. The lawyers won a Circuit Court ruling agreeing they should be made public.

The Obama administration, which initially indicated a willingness to release the photos, bowed to fears of military commanders and reversed course, announcing it is appealing the ruling to the Supreme Court.

The Graham-Lieberman bill will now go to the House.

A senior Democratic aide said it's "unclear at this point" what the House will do on the bill. The House may not take up the bill at all or take it up as an amendment to the Department of Defense funding authorization bill, the aide said.

CNN's Ted Barrett and Deirdre Walsh contributed to this report.

All About U.S. Congressional News • Lindsay Graham