This is not a good question as you don't specify which type of database you are using, nor do you specify any structure for the table you plan to store the image in.
You should have something like this
TableName: Persons
PersonID FirstName MiddleName LastName FaceImage
1 Johnny B Good binary blob (or path to a file server)
Then you just use a SELECT statements to see if the person exists and if the column FaceImage is NULL or not
This is probably easiest to do in a stored procedure, because other wise you will a couple of extra transactions.
CREATE FUNCTION CheckImageExist(IN _firstName VARCHAR(45), IN _middleName VARCHAR(45), IN _lastName VARCHAR(45), IN _image BLOB)
RETURNS INT
BEGIN
SELECT PersonID, NOT ISNULL(FaceImage) FROM Persons INTO @id, @imageExist
WHERE FirstName = _firstName AND MiddleName = _middleName AND LastName = _lastName;
IF ISNULL(@id) THEN
INSERT INTO () VALUES ();
ELSEIF @imageExist = 1 THEN
UPDATE Persons SET FaceImage = _image WHERE PersonID = @id;
ELSE
END IF;
RETURN @imageExist;
END
In the above example I have used MySQL syntax, but it should be similar for other databases.
Also the syntax might not be 100% correct. It is more of a guidance to a solution.