bug fix on function image_buffer_realloc

Signed-off-by: Diogo C. Luvizon <diogo@luvizon.com>