Fix getting the merged image dimensions