Sounds like your issue is with the php script which does not return an image.But PHP is out of the scope of the C2 forum, try to check stackoverflow.com in case some snippet of code might already be there.