fix height < width comparison