I once had this problem too. What I did is to stop thinking on it when I had the desire. Try thinking in something aside from porn. For example, in music you like, unless its sexual, in your favourite car, in a beautiful landscape. Or better, read the Bible with attention to expel the demons...