Improved reliability for attaching photo previews.

Previously, we were doing no scaling of the previews
(to be more clear, we were, but then it was removed).
As a result, when you attached large images, we occasionally,

Now, we have restored the scaling of the images. However,
That created a possible divide-by-zero error if we were
launching the thumbnail loading before we had performed
an initial layout and measure pass (because we had no
width or height values for our view).

To eliminate this possible error, we now perform a
check for this case and don't attempt the photo
load if we would have an error. Additionally, we have
added a separate call to load the photo inside onLayout
when we know that the attachment tile has a width and height.

Change-Id: I3650f3d240e79242bcf30170b44eb6b3c1fd0c87
2 files changed