In iCloud, there is a photo share feature allows you to seamlessly sync and store your photos and videos across all of your Apple devices. It is iCloud Photos. With this feature, you’ll always have access to your entire and most recent iCloud Photo Library collection. iCloud Photos works with iPhone, iPad, iPod touch, Mac, and even Windows computers. You can transfer photos from iPhone to computer or transfer photos from iPad to Mac easily and quickly.
Maybe you can try this:
Go to Settings > iCloud in your iPad > Sign in with your Apple ID > Turn on Photos. Then in your iMac you can proceed as the same as your iPad, subscribe your Apple ID and turn on Photos.