Fix typo in allocation

This was causing the target distribution for all images to be
calculated according to the current values of the last image
through the previous loop.

Change-Id: I3d5190c78849b77933e18c5cf6a9c7443945b6cd