fix get image path and temporary folder directory