Preserve mapping between pixels id and thumbnail when retrieving set

Return structure array with three fields: thumbnail, pixels and image.
Fix image input validation in getThumbnail*() methods