Try a hunch that the reason 'Given I am on the images page' works every time but the first time is that the next instruction is executing before the size value is retrieved, hence causing validation errors