Added null check when getting attachments, fixed bug that caused mime-type to be read from the parent JSON instead of the attachment JSON