modified getcardimage