Any references within your web pages should be root relative … you should not directly use any URL to a virtualized view of a sandbox … those URLs are generated strictly for purposes of preview. Your URL should be your real URLs in your deployed site … remember, Alfresco is designed to push an approved snapshot to a remote file server or Alfresco server or push, where your web server is configured to point to the root of your deployed app.
Within the authoring context, so long as your paths are root relative, everything should virtualize properly via our constructed URLs so you can test the site prior to deployment.
Kevin