[BUGFIX] Prevent IconUtility to throw PHP Warning

Do an array typecast while using function in_array()
Clean up the code to make it more clear

Change-Id: I97738ab4bc4e1e4c346cd25836e2b4d1f875ec23
Resolves: #56558
Releases: 6.2, 6.1
Reviewed-on: https://review.typo3.org/28065
Reviewed-by: Oliver Klee
Reviewed-by: Stefan Neufeind
Tested-by: Stefan Neufeind