diff --git a/screening/source/java/ch/systemsx/cisd/openbis/dss/etl/Hdf5ThumbnailGenerator.java b/screening/source/java/ch/systemsx/cisd/openbis/dss/etl/Hdf5ThumbnailGenerator.java
index d2701402984cad156206ae84a9c5ab7794eee44e..b0e4a87b87101bf25a1da56e0868e6820382cb84 100644
--- a/screening/source/java/ch/systemsx/cisd/openbis/dss/etl/Hdf5ThumbnailGenerator.java
+++ b/screening/source/java/ch/systemsx/cisd/openbis/dss/etl/Hdf5ThumbnailGenerator.java
@@ -434,9 +434,7 @@ public class Hdf5ThumbnailGenerator implements IHDF5WriterClient
     private List<ThumbnailData> generateThumbnailInternally(ImageFileInfo imageFileInfo,
             String imageIdOrNull, ByteArrayOutputStream bufferOutputStream) throws IOException
     {
-        BufferedImage image =
-                loadUnchangedImage(imageFileInfo.getImageRelativePath(), imageIdOrNull);
-
+        BufferedImage image = loadUnchangedImage(imageFileInfo.getImageRelativePath(), imageIdOrNull);
         int widht = thumbnailsStorageFormat.getMaxWidth();
         int height = thumbnailsStorageFormat.getMaxHeight();
         if (thumbnailsStorageFormat.getZoomLevel() != null)
@@ -445,17 +443,15 @@ public class Hdf5ThumbnailGenerator implements IHDF5WriterClient
             height = (int) Math.round(thumbnailsStorageFormat.getZoomLevel() * image.getHeight());
         }
 
-        BufferedImage thumbnail =
-                ImageUtil.rescale(image, widht, height, false,
-                        thumbnailsStorageFormat.isHighQuality());
-
+        boolean highQuality = thumbnailsStorageFormat.isHighQuality();
+        BufferedImage rescaledImage = ImageUtil.rescale(image, widht, height, false, highQuality);
+        
         final List<ThumbnailData> thumbnails = new ArrayList<ThumbnailData>();
         for (String channelCode : getChannelsToProcess(imageFileInfo.getChannelCode()))
         {
-            thumbnail =
-                    applyTransformationsChain(thumbnail, channelCode,
-                            channelColors.get(channelCode));
-
+            ColorComponent colorComponent = channelColors.get(channelCode);
+            BufferedImage thumbnail = applyTransformationsChain(rescaledImage, channelCode, colorComponent);
+            bufferOutputStream.reset();
             thumbnailsStorageFormat.getFileFormat().writeImage(thumbnail, bufferOutputStream);
             thumbnails.add(new ThumbnailData(bufferOutputStream.toByteArray(),
                     thumbnail.getWidth(), thumbnail.getHeight(), thumbnail.getColorModel()