checking image size and correcting stuff