CON-1993 | floated images exceeding intended bounds fix

the selectors in lines 23-42 are quite complex. Is it necessary? Could we simplify them?