I think you want to use $\displaystyle 5^2 = \left(\frac{b}{2}\right)^2 + h^2\tag{1},$
assuming you mean to be using the Pythagorean Theorem - you need to sum the terms on the right of $(1)$, in contrast to what you've written in your question: $ 5^2 = \left(\frac{b}{2}\right)^2 \cdot h^2$.
$24 = b\cdot h \implies h = \dfrac{24}{b} \tag{2}$
So from $(1)$ we get $\quad 25 = \dfrac{b^2}{4} + h^2\tag{3}.$
Substitute your value for $h$ (found from $(2)$) into $(3)$, and solve for $b$.
$25 = \dfrac{b^2}{4} + \left(\dfrac{24}{b}\right)^2 \implies 100b^2 = b^4 + 4\cdot24^2\tag{3}\implies b^4 - 100 b^2 + 2304 = 0$ $\iff (b^2 - 36)(b^2 - 64) = 0\tag{4}$
Both factors in $(4)$ are a "difference of squares": so there will be four solutions to $(4)$, two of which are negative, so you need to throw those out (can't have negative length!).
That leaves you with two possible solutions for the base: $b_1 = x_1,$ or $b_2=x_2$, and respectively, when $b_1 = x_1, \;h_1=\dfrac{x_2}{2}$, or when $b_2 = x_2, \; h_2 = \dfrac{ x_1}{2}$.