Praise be to Allaah.
I hope that there will be nothing wrong with it because when
you earned it you were not certain that it was haraam because you were
unaware of the shar’i ruling, or because of the confusion resulting from
those who permit photography. Allaah says concerning the people who deal
with riba (interpretation of the meaning):
“So whosoever receives an admonition from his Lord and
stops consuming Riba, shall not be punished for the past; his case is for
Allaah (to judge); but whoever returns (to Riba), such are the dwellers of
the Fire — they will abide therein.”
[al-Baqarah 2:275].
May Allaah save us and you from it. We understand from this
verse that the past earnings from work that is not Islamically acceptable
are permissible, if a person repents to Allaah and gives it up. If you give
it or part of it in charity to be on the safe side, that is good, because
the Prophet (peace and blessings of Allaah be upon him) said: “Whoever
guards against the doubtful matters will protect his religious commitment from shortcomings and will protect his honour from slander.” As for it being obligatory to give it in charity, I do not know of any clear evidence to that effect. End quote.