Storing images to your hard drive is legal unless the images themselves are illegal, like child porn, or the way the images ended up on the internet was illegal, like pirated copies. (The pirating issue depends on local laws.)
Reusing or republishing images from the internet is generally not legal, in most cases someone will have a copyright. For this you would either need to ensure that the image is in the public domain (freely usable by everyone) or get the permission of the copyright holder.