Thanks Joseph for your suggestions.
Changing the path itself did not work, but I checked the index file for 'data-sap-ui-resourceroots' and it was available. I did some search and came across this thread,
http://stackoverflow.com/questions/25719860/how-load-all-local-resource-in-a-specific-directory
and so added the thumbnail folder path to 'resourceroots' in a separate line and now my images are displayed properly and I am able to see the folder under source tab in developer tools.
One thing though. I removed the newly added line from the code now, and still my images are loaded properly.