php encode images for raw string