Thanks for the info.
In this case, if you are using staging, you should be also using the same code names for both sites - they should be basically identical. So, in this case the folder names will be the same. Or, another option would be not using the site specific subfolders for media files.
In the code behind, if you are changing the values - at what event are you doing it? Isn't it possible that you are changing the values too early or too late in the life cycle? Also, you need to call the ReloadData method to reload the values.