An extra is appearing in my source code–how do I diagnose the source?

I’ve used these in a template to remove all p tags from an editor:

remove_filter('acf_the_content', 'wpautop');

// This is where the content of the editor was written out by the template

add_filter('acf_the_content', 'wpautop'); //add back the filter 
//so it doesn't mess with other stuff

Also you could try deleting the line break between the images. It will look ugly in the editor but may solve the issue.

Edit: I just realized this is for acf field, but the ACF plugin could also solve your problem this way…