A former British police officer has been convicted of posting offensive content on Facebook after he reposted an image mocking Islam.