def calculate_image_height(matrix):
    """
    Original message seems to be divided into 7 images.
    The first set of rows only have a 1 in the last position which seems to indicate
    the height of each image.
    This is overkill, but hey! Someone might want to learn about generators...
    :param matrix: numpy.ndarray created from message text
    :return: integer height in number of rows
    """
    def _generator():
        for row in matrix[1:]:  # skip first row
            _sum = sum(row)
            if _sum == 1:
                yield _sum
            else:
                break
    image_height = sum(x for x in _generator()) + 1  # add 1 for the skipped first row
    return image_height