How to correctly download images and use it?

The travel application I’m working on should support offline mode. To get it working I’m downloading all city images upon user request to corodova.file.documentsDirectory/images. Download is working fine. However, when I try to set img src to corodova.file.documentsDirectory/images/myimage nothing happens and I’m seeing the following error in the console: “Not allowed to load local resource”.

I tried different approach and downloaded the images to corodova.file.applicationDirectory/www/img/ and than I set the img src simply to img/my-city/whatever. This is working ok on simulator but when testing on iphone it fails to create the my-city directory with error code 3.

I’m working on ios environment.

Any idea?