How can i filter this query, and show only one time first name and last name with all jpg records?

MySQL query
How can i filter this query, and show only one time user with first name and last name, with all jpg records?

I have 2 tables: patient and rtgscan. On table rtgscan patientId is foreign key.

Technology what i used: js, node.js, express.js, handlebars

Thanks