Use enum values

Replace the hard-coded numeric values (direction and imageIndex) with
enum values