small fix about resize condition when selection is near image border