Well I do not see this particular option in the All-New Yahoo Mail so if you are using that, temporarily switch to Yahoo Classic Mail. Just click Options and then Switch to Yahoo Mail Classic. Now on the lower left you will see My Attachments and My Photos. Click either one and you will see a page of thumbnails for the photo attachments or a list of attachments. Now at the top of either one of those, click Message View.
Now a window listing all the emails with attachments will show. Check the boxes of the ones you want to delete and click the Delete button. If you want to Refine the results use the options on the left panel.