Welcome to Android Central! Are you talking about the Yahoo Mail app, or the stock Email app (or Gmail app) with your Yahoo Mail account added to it?
In general, if you use the POP3 server for an email account, the emails get saved directly to the phone (and can therefore get lost if something happens to the phone, and if the email server was set to delete the email from the server once it was downloaded). I typically recommend against using this method. Using the IMAP server is better, since the emails remain on the server -- they're just syncing with the phone. Read more about the difference here: IMAP vs POP3
But this wouldn't necessarily be related to losing your contacts and pictures. Can you give more details about what happened?