imported some image mapping code