[mediaGallery] Added toURL() support

Hey @mangini,

Can you review this simple PR based on https://plus.google.com/100132233764003563318/posts/cZ5ZJWgC6hd?