Fix Bug when width are not equal to height