fixes #4111 - Add image user data flag to API

fixes #4111 
Please use ```refute``` and ```assert``` instead of ```assert_equal boolean```