prevent image overflows