You can add the missing as the shape[i] that correspond to the missing information. Do that if part of kshp and imshp have None value.