Only show posts with image and the correct ammount of posts in loop

I think that the only way is to query the database with LIKE statement and get all IDs and then create a separate WP_Query object for the list of post ID’s. Check this guide for example.