Added method setBasePath() to set base directory, to get relative path of images