isValidImageShape

Extension to check if a tensor shape is compatible with an image layout.