You can use an automation app here.
Setup a flow like this:
(Click image to enlarge)
Location of relevant blocks:
- Interface → Screen Orientation?
- Settings → Wallpaper image set
After setting it up, make sure to install the permission it asks for - set wallpaper.
This worked in my COS12 and PA build of Android 5.1 but somehow failed in Android 5.1 nightly build of Vanir ROM.
Try the trial version, before buying from Play Store.
Profile: State → Display → Display Orientation →Portrait
Task: (Actions): Display → Set Wallpaper → fill the details
For landscape orientation, you can either add an exit task by long pressing the task entry next to linked profile under Profiles tab and choosing "Add exit task", or setup a new profile for landscape orientation and create a new task for it.
For latter approach, make sure to disable Restore Settings for both the profiles. A profile's properties can be accessed by long-pressing the profile and tapping the settings icon.
Tasker worked in both Android 5.0 and 5.1 ROMs installed in my device.