Changed temp pathing and fixed bug for nested images.