This will resize your intermediate photos so that the longest side of the photo is equal to the target size below and the filesize will be close to the chosen size.
(Use only the original picture)