prevent NullPointerException while accessing thumbnail