Using an Image Block, with images that are uploaded at the same size is an important first step. Squarespace has a guide on formatting your images for display on the web that you can find here:
It would seem that images that are 1500px wide will be the best bet. Personally, I like images in a 3:2 aspect ratio, which puts them at 1500px x 1000px in size.
After that, you can manually resize your Blocks after you have them in place. Here is another guide on that:
You shouldn't need to use any code to make this happen. If your images are formatting at odd sizes even after following these steps, I recommend reaching out to customer care to ask them what may be going on here.