Maybe if I show You a graph, it will be easier:
Red dot is center of image, now:
Area 1: Can only move down if collide
Area 2: Can only move right if coolide
Area 3: Can only move right if collide
Area 4: Can only move up if collide
Area 5: Can only move up if collide
Area 6: Can only move left if collide
Area 7: Can only move left if collide
Area 8: Can only move down if collide
The rectangle around triangle shows it full scale, together with transparent pixels. I can't make good logical statements for it to work, especially when trying to deal with area 1 and 2, area 3 and 4 etc because I can't think of good if to make it.