do not make image bigger then original

Signed-off-by: Jan Linhart <jan.linhart@easysoftware.cz>