Truncate image filenames if necessary to fit OS limits.

Change-Id: I8026c822f0b00d0ca8edc2c5ee23efd91b8567ae
Merge "Truncate image filenames if necessary to fit OS limits."