fix image cache dir problem
fix issue with temp dirs