In my case it was a blank space between two PHP tags:
<?php
?>
(space here)
<?php
?>
Here is a quick fix for that.
Editing the /wp-content/plugins/nextgen-gallery/admin/wp25/functions.php
Search for the function upload_images()
Scroll down after the end of the loop and check for this code:
//create thumbnails
nggAdmin::generatethumbnail(WINABSPATH.$gallerypath,$imageslist);
BEFORE THAT add this:
//create resized pictures
nggAdmin::resizeImages(WINABSPATH.$gallerypath,$imageslist);
That should do the work. 😀