fix imagepath and make image shim work for local files