An upper surface of a piezoelectric layer in an area opposed to a pressure generating chamber and a side surface of the piezoelectric layer in an arrangement direction of the piezoelectric elements are covered with an upper electrode. If so, all pixels in a neighborhood of the dead pixel candidate are determined as to-be-detected pixels. A method for preparing a pharmaceutical composition includes producing liposomes from phospholipids, preferably in the presence of a pharmaceutically active substance to be encapsulated within the liposomes, and mixing the liposomes with hyaluronic acid.