refactoring: add conversion utility methods between File and url
Add the ability to send local images to external viewer

This is needed for the implementation of #3438.