writing to temp cache for stbi then remove