I am not sure an extension will really help with this since it will be pretty custom depending on your server and file locations. I would recommend using a PHP script to serve the image. You can then always use that script as your image source and you can do some logic to send the appropriate image back as needed.