fixing the problem where a thmbnail image was generated only to the last
uploaded picture