The code: 
AttachmentManager.ResizeImageAttachment(ai, resizeToWidth, resizeToHeight, resizeToMaxSideSize);
 returns oryginal data (unresized) without throws any exception when ai.AttachmentImageHeight and ai.AttachmentImageWidth are 0 in argument ai of method ResizeImageAttachment. 
Properties AttachmentImageHeight and AttachmentImageWidth are 0 when object of class AttachmentInfo is created from not supported image formats.
If image format 
is not supported by GDIplus on server but 
is supported by web browser -> image is unresized on page.