Move photos from iMac to iCloud
Solution 1:
If you have OS X Yosemite (10.10), you can use iCloud Drive to store your photos, as you're only limited to the amount of storage space you have available under your iCloud account. Apple details how you can store documents onto your iCloud Drive here
Solution 2:
As this question has been reactivated, I will give an answer based on macOS Sierra and iCloud Photo Library.
If you photos are not already in the Photos app, import them into the Photos app.
Then in your iCloud settings (System Preferences > iCloud), ensure the check box next to "Photos" is selected, then press "Options" for Photos and ensure the check box for "iCloud Photo Library" is selected as shown:
The images will then upload to iCloud, one thing to be aware of as you mention thousands of images - the free tier of iCloud is 5GB, so you may need to purchase extra storage.