Update Main.c

[MOD] corrected range check for width and height values