Fix adding layer using contents()

The imc:// uri was set regardless of the origin of the content
Fix #1