Divide the available space by the image size:
25 /5 =5
15 / 4 = 3.75
Multiply the image size by the larger scale factor (5)
5 x 5 = 25
4 x 5 = 20
Since the height using 5 is larger than 15, that doesn't work.
Now multiply the image size by 3.75
5 x 3.75 = 18.75
4 x 3.75 = 15
The height is equal to 15 using the smaller scale factor of 3.75, so this would be the largest the image can be.
The dimensions of the image would be 18 3/4 feet x 15 feet.