One of the biggest mistakes people who are new to creating on the web make is the assumption that you can use images that you find on the web. Images cannot simply be re-used. This is especially the case for photographs. By default images are copyrighted. Don’t get yourself into trouble by illegally copying images. Educational use will not protect you.
Because your projects are likely to be used in your portfolios, you should stick to images that you are allowed to freely use. There are many sources for royalty free images that you can use. I recommend when searching that you select only images that you are free to use for commercial purposes, as you never know how you will use your project in the future. In addition, it is considered good practice to credit the source of your images, even when it is not technically required.
Creative Commons provides the most robust and common licensing mechanism for web resources that you are able to use in your projects. They provide a good overview on how Creative Commons licenses work. Consider how you want to license each element that you create as well as your overall project. Be aware that some items that you use may be licensed as “share alike” such that you cannot copyright them, rather you must use a similar license on your derived product.
The easiest way to ensure your images are safe is to create them yourself. Especially if you are creating a portfolio website, it is best to create the majority of the images yourself.