Made image type dynamic