Check if array of tiles is large enough

G_array_index doesn't check if it's within the bounds of the array. This
may crash the application if there's more flowers than tiles.

We have to check this ourself to avoid running over the end. Check that
the index is low enough to be within the bounds of the array before
calling g_array_index.

Signed-off-by: Marcus Karlsson <mk@acc.umu.se>