isImageSizeOk() surrounded with try-catch