Added method to compute image path