modified showImage method, now its working correctly