Handling image with self-hosted php base64 conversion