Modified the method to get the thumbnail of photo