Mixing tabs and spaces will give you very troublesome indentations. I recommend to stick with spaces only, since not everyone's tab settings are the same.
Somewhere in your program you have to get a value for image_name before you call your function.