fixing minor js error in path; fixing image generation