If you want the client to see your changes, you must ensure that the specific session has streaming disabled (e.g. oSession.bBufferResponse = true); you can set this inside OnBeforeRequest or OnPeekAtResponseHeaders.
Replacing the body is trivial:
oSession.ResponseBody = File.ReadAllBytes("C:\\temp\\myimage.jpg");
The ResponseBody property setter will automatically correct the Content-Length and encoding related headers. If you change the MIME type (e.g. returning a JPG rather than a GIF) you may manually need to update the Content-Type header:
oSession.oResponse["Content-Type"] = "image/jpeg";
To use the File.ReadAllBytes method, you will need to ensure that you have
at the top of your script, and that the file path you use has all \ characters escaped to \\.
Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.