Main madified in order to use the header to retrieve the height and widht and
not hardcoded coordinates.