added getLocalImage util function