The unsqueeze was necessary, as your channel dimension was missing.
Since you are using an image, you should also use nn.MaxPool2d instead of nn.MaxPool1d.
Here is a small example:
model = nn.Sequential(
    nn.Conv2d(in_channels=1, out_channels=3, kernel_size=3, stride=1, padding=1),
    nn.MaxPool2d(2)
)
x = torch.randn(4, 1, 99, 99)
output = model(x)
print(output.shape)
> torch.Size([4, 3, 49, 49])