Added image normalization and thumbnail resizing