added funtionality for genearting heterogenous image but its not really working...