1. A scanner, the scanner comprising: a platen for accommodating one or more media sheets thereon; a scanlid pivotally coupled relative to the platen and movable between a closed position in which the scanlid substantially covers the platen and an open position in which the platen is substantially uncovered, the scanlid providing a background for scanning of the one or more media sheets; an illuminating mechanism operably coupled to the scanlid, the illuminating mechanism being selectively activated for selectively illuminating the background for scanning of the one or more media sheets; a scanhead configured to scan the one or more media sheets; and a controller communicatively coupled to the illuminating mechanism for: scanning the one or more media sheets by the scanhead upon activation of the illuminating mechanism captures a background image of the one or more media sheets, scanning the one or more media sheets by the scanhead upon deactivation of the illuminating mechanism captures a foreground image of the one or more media sheets, detecting edges of each media sheet of the one or more media sheets based on the background image, wherein the detected edges of each media sheet demarcate each media sheet of the one or more media sheets.