Detecting the presence, position or size of a sheet or correcting its position before scanning