Added functionality for a default site in multisite environments. Also added the siteurl to media items.