Regarding expressing gratitude to people even before forgiveness….this is possible.
Because you are expressing gratitude for what you received from those people and they made you happy knowingly and unknowingly. The act of hurt may be from different set of actions.
Gratitude and forgiveness is for different set of actions.
Like a spouse can be in gratitude mode what what is happily received from his/her partner and yet get hurt by some actions, so forgiveness part comes only for latter actions.
Most of the times we even hate or ignore to be in gratitude mode for whatever is received because of subsequent hurt from same people.
Raising our spiritual levels, we can still give gratitude to such people !!