Adapting the size of pictures to fit the template blocks in the editor