API: used reflection in order to have an arbitrary number of parameter for getFormattedImage (fixes #1752)