merge mask and resize