Remove empty borders from images