Adding imageUrl function.
Fixing function and adding tests.